diff --git a/console/src/main/resources/static/src/components/BatchHandle/BatchHandle.js b/console/src/main/resources/static/src/components/BatchHandle/BatchHandle.js index 24bcefedd..10b3bb9bb 100644 --- a/console/src/main/resources/static/src/components/BatchHandle/BatchHandle.js +++ b/console/src/main/resources/static/src/components/BatchHandle/BatchHandle.js @@ -12,106 +12,141 @@ */ import React from 'react'; +import PropTypes from 'prop-types'; import { Dialog, Pagination, Transfer } from '@alifd/next'; import { request, aliwareIntl } from '../../globalLib'; import './index.less'; -/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/ class BatchHandle extends React.Component { - constructor(props) { - super(props); - this.state = { - visible: false, - valueList: props.valueList || [], - dataSourceList: props.dataSource || [], - currentPage: 1, - total: 0, - pageSize: 10, - dataSource: {} - }; - } - componentDidMount() { } - openDialog(dataSource) { - this.setState({ - visible: true, - dataSource: dataSource, - pageSize: dataSource.pageSize - }, () => { - this.getData(); - console.log(this.transfer._instance.filterCheckedValue); - this.transfer._instance.filterCheckedValue = function (left, right, dataSource) { - var result = { - left: left, - right: right - }; + static propTypes = { + valueList: PropTypes.array, + dataSource: PropTypes.array, + onSubmit: PropTypes.func, + }; - console.log(left, right, dataSource); - // if (left.length || right.length) { - // var value = dataSource.map(function (item) { - // return item.value; - // }); - // value.forEach(function (itemValue) { - // if (left.indexOf(itemValue) > -1) { - // result.left.push(itemValue); - // } else if (right.indexOf(itemValue) > -1) { - // result.right.push(itemValue); - // } - // }); - // } + constructor(props) { + super(props); + this.state = { + visible: false, + valueList: props.valueList || [], + dataSourceList: props.dataSource || [], + currentPage: 1, + total: 0, + pageSize: 10, + dataSource: {}, + }; + } - return result; - }; - }); - } - closeDialog() { - this.setState({ - visible: false - }); - } - getData() { - const dataSource = this.state.dataSource; - request({ - url: `/diamond-ops/configList/serverId/${dataSource.serverId}?dataId=${dataSource.dataId}&group=${dataSource.group}&appName=${dataSource.appName}&config_tags=${dataSource.config_tags || ''}&pageNo=${this.state.currentPage}&pageSize=${dataSource.pageSize}`, - success: res => { - if (res.code === 200) { - this.setState({ - dataSourceList: res.data.map(obj => { - return { - label: obj.dataId, - value: obj.dataId - }; - }) || [], - total: res.total - }); - } - } - }); - } - changePage(currentPage) { - this.setState({ - currentPage - }, () => { - this.getData(); - }); - } - onChange(valueList, data, extra) { - this.setState({ - valueList - }); - } - onSubmit() { - this.props.onSubmit && this.props.onSubmit(this.state.valueList); - } - render() { - // console.log("valueList: ", this.state.valueList, this.transfer); + componentDidMount() {} - return -
- this.transfer = ref} listStyle={{ height: 350 }} dataSource={this.state.dataSourceList || []} value={this.state.valueList} onChange={this.onChange.bind(this)} language={aliwareIntl.currentLanguageCode || 'zh-cn'} /> - -
-
; - } + openDialog(dataSource) { + this.setState( + { + visible: true, + dataSource, + pageSize: dataSource.pageSize, + }, + () => { + this.getData(); + this.transfer._instance.filterCheckedValue = function(left, right, dataSource) { + const result = { + left, + right, + }; + + return result; + }; + } + ); + } + + closeDialog() { + this.setState({ + visible: false, + }); + } + + getData() { + const { dataSource } = this.state; + request({ + url: `/diamond-ops/configList/serverId/${dataSource.serverId}?dataId=${ + dataSource.dataId + }&group=${dataSource.group}&appName=${ + dataSource.appName + }&config_tags=${dataSource.config_tags || ''}&pageNo=${this.state.currentPage}&pageSize=${ + dataSource.pageSize + }`, + success: res => { + if (res.code === 200) { + this.setState({ + dataSourceList: + res.data.map(obj => ({ + label: obj.dataId, + value: obj.dataId, + })) || [], + total: res.total, + }); + } + }, + }); + } + + changePage(currentPage) { + this.setState( + { + currentPage, + }, + () => { + this.getData(); + } + ); + } + + onChange(valueList, data, extra) { + this.setState({ + valueList, + }); + } + + onSubmit() { + this.props.onSubmit && this.props.onSubmit(this.state.valueList); + } + + render() { + // console.log("valueList: ", this.state.valueList, this.transfer); + + return ( + +
+ (this.transfer = ref)} + listStyle={{ height: 350 }} + dataSource={this.state.dataSourceList || []} + value={this.state.valueList} + onChange={this.onChange.bind(this)} + language={aliwareIntl.currentLanguageCode || 'zh-cn'} + /> + +
+
+ ); + } } -/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/ -export default BatchHandle; \ No newline at end of file + +export default BatchHandle; diff --git a/console/src/main/resources/static/src/components/BatchHandle/index.js b/console/src/main/resources/static/src/components/BatchHandle/index.js index 10c14ed78..4400bc576 100644 --- a/console/src/main/resources/static/src/components/BatchHandle/index.js +++ b/console/src/main/resources/static/src/components/BatchHandle/index.js @@ -13,4 +13,4 @@ import BatchHandle from './BatchHandle'; -export default BatchHandle; \ No newline at end of file +export default BatchHandle; diff --git a/console/src/main/resources/static/src/components/CloneDialog/CloneDialog.js b/console/src/main/resources/static/src/components/CloneDialog/CloneDialog.js index 154aad1c9..94675984d 100644 --- a/console/src/main/resources/static/src/components/CloneDialog/CloneDialog.js +++ b/console/src/main/resources/static/src/components/CloneDialog/CloneDialog.js @@ -15,174 +15,241 @@ import React from 'react'; import './index.less'; import { getParams, request, aliwareIntl } from '../../globalLib'; import { Button, Dialog, Field, Form, Select } from '@alifd/next'; + const FormItem = Form.Item; const { AutoComplete: Combobox } = Select; -/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/ class CloneDialog extends React.Component { + constructor(props) { + super(props); + this.allPolicy = [ + { + value: 'abort', + label: aliwareIntl.get('nacos.component.CloneDialog.Terminate_the_clone0'), + }, + { value: 'skip', label: aliwareIntl.get('nacos.component.CloneDialog.skip') }, + { value: 'overwrite', label: aliwareIntl.get('nacos.component.CloneDialog.cover') }, + ]; + this.defaultPolicy = 'abort'; + this.state = { + visible: false, + serverId: '', + tenantFrom: {}, + tenantTo: '', + dataId: '', + group: '', + appName: '', + configTags: '', + records: [], + namespaces: [], + policy: this.defaultPolicy, + policyLabel: aliwareIntl.get('nacos.component.CloneDialog.Terminate_the_clone0'), + total: 0, + }; + this.field = new Field(this); + this.formItemLayout = { + labelCol: { + fixedSpan: 6, + }, + wrapperCol: { + span: 18, + }, + }; + } - constructor(props) { - super(props); - this.allPolicy = [{ value: 'abort', label: aliwareIntl.get('nacos.component.CloneDialog.Terminate_the_clone0') }, { value: 'skip', label: aliwareIntl.get('nacos.component.CloneDialog.skip') }, { value: 'overwrite', label: aliwareIntl.get('nacos.component.CloneDialog.cover') }]; - this.defaultPolicy = 'abort'; - this.state = { - visible: false, - serverId: '', - tenantFrom: {}, + componentDidMount() {} + + openDialog(payload, callback) { + const serverId = getParams('serverId') || 'center'; + this.checkData = payload.checkData; + this.callback = callback; + request({ + type: 'get', + url: `/diamond-ops/service/serverId/${serverId}/namespaceInfo`, + success: res => { + if (res.code === 200) { + const dataSource = []; + res.data.forEach(value => { + if (value.namespace !== payload.tenantFrom.id) { + dataSource.push({ + value: value.namespace, + label: `${value.namespaceShowName} | ${value.namespace}`, + }); + } + }); + this.setState({ + visible: true, + serverId: payload.serverId, + tenantFrom: payload.tenantFrom, tenantTo: '', - dataId: '', - group: '', - appName: '', - configTags: '', - records: [], - namespaces: [], - policy: this.defaultPolicy, - policyLabel: aliwareIntl.get('nacos.component.CloneDialog.Terminate_the_clone0'), - total: 0 - }; - this.field = new Field(this); - this.formItemLayout = { - labelCol: { - fixedSpan: 6 - }, - wrapperCol: { - span: 18 - } - }; - } - - componentDidMount() { } - - openDialog(payload, callback) { - let serverId = getParams('serverId') || 'center'; - this.checkData = payload.checkData; - this.callback = callback; - request({ - type: 'get', - url: `/diamond-ops/service/serverId/${serverId}/namespaceInfo`, - success: res => { - if (res.code === 200) { - let dataSource = []; - res.data.forEach(value => { - if (value.namespace !== payload.tenantFrom.id) { - dataSource.push({ - value: value.namespace, - label: value.namespaceShowName + " | " + value.namespace - }); - } - }); - this.setState({ - visible: true, - serverId: payload.serverId, - tenantFrom: payload.tenantFrom, - tenantTo: '', - dataId: payload.dataId, - group: payload.group, - appName: payload.appName, - configTags: payload.configTags, - records: payload.records, - namespaces: dataSource, - total: payload.total - }); - this.field.setValue('select', ''); - } else { - Dialog.alert({ - language: aliwareIntl.currentLanguageCode || 'zh-cn', - title: aliwareIntl.get('nacos.component.CloneDialog.get_the_namespace_failed'), - content: res.message - }); - } - } - }); - } - - closeDialog() { - this.setState({ - visible: false - }); - } - - setTenantTo(value) { - this.field.setValue(value); - this.setState({ - tenantTo: value - }); - } - - setPolicy(...value) { - this.setState({ - policyLabel: value[1].label, - policy: value[0] - }); - } - - getQuery() { - if (this.state.records.length > 0) { - return aliwareIntl.get('nacos.component.CloneDialog.|_the_selected_entry4'); + dataId: payload.dataId, + group: payload.group, + appName: payload.appName, + configTags: payload.configTags, + records: payload.records, + namespaces: dataSource, + total: payload.total, + }); + this.field.setValue('select', ''); + } else { + Dialog.alert({ + language: aliwareIntl.currentLanguageCode || 'zh-cn', + title: aliwareIntl.get('nacos.component.CloneDialog.get_the_namespace_failed'), + content: res.message, + }); } - if (this.state.dataId === '' && this.state.group === '' && this.state.appName === '' && this.state.configTags.length === 0) { - return ''; - } - let query = " |"; - if (this.state.dataId !== '') { - query += ' DataId: ' + this.state.dataId + ','; - } - if (this.state.group !== '') { - query += ' Group: ' + this.state.group + ','; - } - if (this.state.appName !== '') { - query += aliwareIntl.get('nacos.component.CloneDialog.HOME_Application') + this.state.appName + ','; - } - if (this.state.configTags.length !== 0) { - query += aliwareIntl.get('nacos.component.CloneDialog.tags') + this.state.configTags + ','; - } - return query.substr(0, query.length - 1); - } + }, + }); + } - doClone() { - this.field.validate((errors, values) => { - if (errors) { - return; - } - this.closeDialog(); - this.checkData.tenantTo = this.state.tenantTo; - this.checkData.policy = this.state.policy; - this.callback(this.checkData, this.state.policyLabel); - }); - } + closeDialog() { + this.setState({ + visible: false, + }); + } - render() { - const init = this.field.init; - const footer =
-
; + setTenantTo(value) { + this.field.setValue(value); + this.setState({ + tenantTo: value, + }); + } - return
- -
- -

{this.state.tenantFrom.name}{" | " + this.state.tenantFrom.id} -

-
- -

{this.state.total} {this.getQuery()}

-
- - - - - - - -
-
-
; + setPolicy(...value) { + this.setState({ + policyLabel: value[1].label, + policy: value[0], + }); + } + + getQuery() { + if (this.state.records.length > 0) { + return aliwareIntl.get('nacos.component.CloneDialog.|_the_selected_entry4'); } + if ( + this.state.dataId === '' && + this.state.group === '' && + this.state.appName === '' && + this.state.configTags.length === 0 + ) { + return ''; + } + let query = ' |'; + if (this.state.dataId !== '') { + query += ` DataId: ${this.state.dataId},`; + } + if (this.state.group !== '') { + query += ` Group: ${this.state.group},`; + } + if (this.state.appName !== '') { + query += `${aliwareIntl.get('nacos.component.CloneDialog.HOME_Application') + + this.state.appName},`; + } + if (this.state.configTags.length !== 0) { + query += `${aliwareIntl.get('nacos.component.CloneDialog.tags') + this.state.configTags},`; + } + return query.substr(0, query.length - 1); + } + + doClone() { + this.field.validate((errors, values) => { + if (errors) { + return; + } + this.closeDialog(); + this.checkData.tenantTo = this.state.tenantTo; + this.checkData.policy = this.state.policy; + this.callback(this.checkData, this.state.policyLabel); + }); + } + + render() { + const { init } = this.field; + const footer = ( +
+ +
+ ); + + return ( +
+ +
+ +

+ {this.state.tenantFrom.name} + {` | ${this.state.tenantFrom.id}`} +

+
+ +

+ {this.state.total} {this.getQuery()}{' '} +

+
+ + + + + - - - - -
- -
+ handleSubmit() { + this.field.validate((errors, values) => { + if (errors) { + return; + } + request({ + type: 'put', + beforeSend: () => { + this.openLoading(); + }, + url: '/nacos/v1/console/namespaces', + contentType: 'application/x-www-form-urlencoded', + data: { + namespace: values.namespace, + namespaceShowName: values.namespaceShowName, + namespaceDesc: values.namespaceDesc, + }, + success: (res) => { + if (res === true) { + this.closeDialog(); + this.props.getNameSpaces(); + this.refreshNameSpace(); // 刷新全局namespace + } else { + Dialog.alert({ + language: aliwareIntl.currentLanguageCode || 'zh-cn', + title: aliwareIntl.get('com.alibaba.nacos.component.EditorNameSpace.prompt'), + content: res.message, + }); + } + }, + complete: () => { + this.closeLoading(); + }, + }); + }); + } -
- ); + refreshNameSpace() { + setTimeout(() => { + request({ + type: 'get', + url: '/nacos/v1/console/namespaces', + success: (res) => { + if (res.code === 200) { + window.namespaceList = res.data; + } + }, + }); + }, 2000); + } + + validateChart(rule, value, callback) { + const chartReg = /[@#\$%\^&\*]+/g; + + if (chartReg.test(value)) { + callback(aliwareIntl.get('com.alibaba.nacos.component.EditorNameSpace.please_do')); + } else { + callback(); } + } + + render() { + const formItemLayout = { + labelCol: { + fixedSpan: 6, + }, + wrapperCol: { + span: 18, + }, + }; + + const footer = this.state.type === 0 ?
: ; + return ( +
+ + +
+ + + + + + +
+
+
+ +
+ ); + } } -/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/ -export default EditorNameSpace; \ No newline at end of file + +export default EditorNameSpace; diff --git a/console/src/main/resources/static/src/components/EditorNameSpace/index.js b/console/src/main/resources/static/src/components/EditorNameSpace/index.js index 1726297df..af8e66382 100644 --- a/console/src/main/resources/static/src/components/EditorNameSpace/index.js +++ b/console/src/main/resources/static/src/components/EditorNameSpace/index.js @@ -13,4 +13,4 @@ import EditorNameSpace from './EditorNameSpace'; -export default EditorNameSpace; \ No newline at end of file +export default EditorNameSpace; diff --git a/console/src/main/resources/static/src/components/ExportDialog/ExportDialog.js b/console/src/main/resources/static/src/components/ExportDialog/ExportDialog.js index a58c54b3c..0b49e0e45 100644 --- a/console/src/main/resources/static/src/components/ExportDialog/ExportDialog.js +++ b/console/src/main/resources/static/src/components/ExportDialog/ExportDialog.js @@ -15,120 +15,154 @@ import React from 'react'; import { aliwareIntl } from '../../globalLib'; import './index.less'; import { Button, Dialog, Form } from '@alifd/next'; + const FormItem = Form.Item; -/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/ class ExportDialog extends React.Component { - constructor(props) { - super(props); - this.state = { - visible: false, - serverId: '', - tenant: '', - dataId: '', - group: '', - appName: '', - configTags: '', - records: [], - total: 0 - }; - this.formItemLayout = { - labelCol: { - fixedSpan: 4 - }, - wrapperCol: { - span: 20 - } - }; + constructor(props) { + super(props); + this.state = { + visible: false, + serverId: '', + tenant: '', + dataId: '', + group: '', + appName: '', + configTags: '', + records: [], + total: 0, + }; + this.formItemLayout = { + labelCol: { + fixedSpan: 4, + }, + wrapperCol: { + span: 20, + }, + }; + } + + componentDidMount() {} + + openDialog(payload) { + this.setState({ + visible: true, + serverId: payload.serverId, + tenant: payload.tenant, + dataId: payload.dataId, + group: payload.group, + appName: payload.appName, + configTags: payload.configTags, + records: payload.records, + total: payload.total, + }); + } + + closeDialog = () => { + this.setState({ + visible: false, + }); + }; + + getQuery() { + if (this.state.records.length > 0) { + return aliwareIntl.get('nacos.component.ExportDialog.|_The_selected_entry0'); } - - componentDidMount() { } - - openDialog(payload) { - this.setState({ - visible: true, - serverId: payload.serverId, - tenant: payload.tenant, - dataId: payload.dataId, - group: payload.group, - appName: payload.appName, - configTags: payload.configTags, - records: payload.records, - total: payload.total - }); + if ( + this.state.dataId === '' && + this.state.group === '' && + this.state.appName === '' && + this.state.configTags.length === 0 + ) { + return ''; } - - closeDialog() { - this.setState({ - visible: false - }); + let query = ' |'; + if (this.state.dataId !== '') { + query += ` DataId: ${this.state.dataId},`; } - - getQuery() { - if (this.state.records.length > 0) { - return aliwareIntl.get('nacos.component.ExportDialog.|_The_selected_entry0'); - } - if (this.state.dataId === '' && this.state.group === '' && this.state.appName === '' && this.state.configTags.length === 0) { - return ''; - } - let query = " |"; - if (this.state.dataId !== '') { - query += ' DataId: ' + this.state.dataId + ','; - } - if (this.state.group !== '') { - query += ' Group: ' + this.state.group + ','; - } - if (this.state.appName !== '') { - query += aliwareIntl.get('nacos.component.ExportDialog.HOME_Application1') + this.state.appName + ','; - } - if (this.state.configTags.length !== 0) { - query += aliwareIntl.get('nacos.component.ExportDialog.tags2') + this.state.configTags + ','; - } - return query.substr(0, query.length - 1); + if (this.state.group !== '') { + query += ` Group: ${this.state.group},`; } - - doExport() { - // document.getElementById('downloadLink').click(); - let url = this.getLink(); - window.open(url); - this.closeDialog(); + if (this.state.appName !== '') { + query += `${aliwareIntl.get('nacos.component.ExportDialog.HOME_Application1') + + this.state.appName},`; } - - getLink() { - let data = []; - this.state.records.forEach(record => { - data.push({ dataId: record.dataId, group: record.group }); - }); - console.log(encodeURI(JSON.stringify(data))); - let query = `?dataId=${this.state.dataId}&group=${this.state.group}&appName=${this.state.appName}&tags=${this.state.configTags || ''}&data=${encodeURI(JSON.stringify(data))}`; - const baseLink = `/diamond-ops/batch/export/serverId/${this.state.serverId}/tenant/${this.state.tenant.id}` + query; - if (window.globalConfig.isParentEdas()) { - return '/authgw/' + window.edasprefix + baseLink; - } - return baseLink; + if (this.state.configTags.length !== 0) { + query += `${aliwareIntl.get('nacos.component.ExportDialog.tags2') + this.state.configTags},`; } + return query.substr(0, query.length - 1); + } - render() { - const footer =
- {/* */} - -
; + doExport = () => { + // document.getElementById('downloadLink').click(); + const url = this.getLink(); + window.open(url); + this.closeDialog(); + }; - return
- -
- -

- {this.state.tenant.name}{" | " + this.state.tenant.id} -

-
- -

{this.state.total} {this.getQuery()}

-
-
-
-
; + getLink() { + const data = []; + this.state.records.forEach(record => { + data.push({ dataId: record.dataId, group: record.group }); + }); + const query = `?dataId=${this.state.dataId}&group=${this.state.group}&appName=${ + this.state.appName + }&tags=${this.state.configTags || ''}&data=${encodeURI(JSON.stringify(data))}`; + const baseLink = `/diamond-ops/batch/export/serverId/${this.state.serverId}/tenant/${ + this.state.tenant.id + }${query}`; + if (window.globalConfig.isParentEdas()) { + return `/authgw/${window.edasprefix}${baseLink}`; } + return baseLink; + } + + render() { + const footer = ( +
+ {/* */} + +
+ ); + + return ( +
+ +
+ +

+ {this.state.tenant.name} + {` | ${this.state.tenant.id}`} +

+
+ +

+ {this.state.total} {this.getQuery()}{' '} +

+
+
+
+
+ ); + } } -/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/ -export default ExportDialog; \ No newline at end of file + +export default ExportDialog; diff --git a/console/src/main/resources/static/src/components/ExportDialog/index.js b/console/src/main/resources/static/src/components/ExportDialog/index.js index dba12cdd8..9da1eca91 100644 --- a/console/src/main/resources/static/src/components/ExportDialog/index.js +++ b/console/src/main/resources/static/src/components/ExportDialog/index.js @@ -13,4 +13,4 @@ import ExportDialog from './ExportDialog'; -export default ExportDialog; \ No newline at end of file +export default ExportDialog; diff --git a/console/src/main/resources/static/src/components/ImportDialog/ImportDialog.js b/console/src/main/resources/static/src/components/ImportDialog/ImportDialog.js index 50041cae7..2b5b33c3d 100644 --- a/console/src/main/resources/static/src/components/ImportDialog/ImportDialog.js +++ b/console/src/main/resources/static/src/components/ImportDialog/ImportDialog.js @@ -15,111 +15,191 @@ import React from 'react'; import { aliwareIntl } from '../../globalLib'; import './index.less'; import { Balloon, Button, Dialog, Form, Icon, Select, Upload } from '@alifd/next'; + const FormItem = Form.Item; -/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/ class ImportDialog extends React.Component { - constructor(props) { - super(props); - this.formItemLayout = { - labelCol: { - fixedSpan: 4 - }, - wrapperCol: { - span: 20 - } - }; - this.allPolicy = [{ value: 'abort', label: aliwareIntl.get('nacos.component.ImportDialog.To_terminate_the_import0') }, { value: 'skip', label: aliwareIntl.get('nacos.component.ImportDialog.skip1') }, { - value: 'overwrite', - label: aliwareIntl.get('nacos.component.ImportDialog.cover2') - }]; - this.defaultPolicy = 'abort'; - this.state = { - visible: false, - serverId: '', - tenant: '', - policy: this.defaultPolicy, - policyLabel: aliwareIntl.get('nacos.component.ImportDialog.To_terminate_the_import0') - }; + constructor(props) { + super(props); + this.formItemLayout = { + labelCol: { + fixedSpan: 4, + }, + wrapperCol: { + span: 20, + }, + }; + this.allPolicy = [ + { + value: 'abort', + label: aliwareIntl.get('nacos.component.ImportDialog.To_terminate_the_import0'), + }, + { value: 'skip', label: aliwareIntl.get('nacos.component.ImportDialog.skip1') }, + { + value: 'overwrite', + label: aliwareIntl.get('nacos.component.ImportDialog.cover2'), + }, + ]; + this.defaultPolicy = 'abort'; + this.state = { + visible: false, + serverId: '', + tenant: '', + policy: this.defaultPolicy, + policyLabel: aliwareIntl.get('nacos.component.ImportDialog.To_terminate_the_import0'), + }; + } + + componentDidMount() {} + + openDialog(payload, callback) { + this.callback = callback; + this.setState({ + visible: true, + serverId: payload.serverId, + tenant: payload.tenant, + }); + } + + closeDialog = () => { + this.setState({ + visible: false, + }); + }; + + setPolicy = (...value) => { + this.setState({ + policyLabel: value[1].label, + policy: value[0], + }); + }; + + formatter = res => { + if (res.code === 200) { + return { + code: '0', + retData: res, + }; + } else { + return { + code: '1', + error: { + message: res.message, + }, + retData: res, + }; } + }; - componentDidMount() { } + render() { + let uploadLink = `/diamond-ops/batch/import/serverId/${this.state.serverId}/tenant/${ + this.state.tenant.id + }?policy=${this.state.policy}`; - openDialog(payload, callback) { - this.callback = callback; - this.setState({ - visible: true, - serverId: payload.serverId, - tenant: payload.tenant - }); + if (window.globalConfig.isParentEdas()) { + uploadLink = `/authgw/${window.edasprefix}${uploadLink}`; } - - closeDialog() { - this.setState({ - visible: false - }); - } - - setPolicy(...value) { - this.setState({ - policyLabel: value[1].label, - policy: value[0] - }); - } - - formatter(res) { - if (res.code === 200) { - return { - code: '0', - retData: res - }; - } else { - return { - code: '1', - error: { - message: res.message - }, - retData: res - }; + const helpTip = ( + + Data ID{' '} + + } - } - - render() { - let uploadLink = `/diamond-ops/batch/import/serverId/${this.state.serverId}/tenant/${this.state.tenant.id}?policy=${this.state.policy}`; - - if (window.globalConfig.isParentEdas()) { - uploadLink = '/authgw/' + window.edasprefix + uploadLink; - } - const helpTip = Data ID } align={"t"} style={{ marginRight: 5 }} triggerType={"hover"}> -
{aliwareIntl.get('nacos.component.ImportDialog.You_can_only_upload._zip_file_format0') /*只能上传.zip格式的文件*/} - ; - const footer =
{ + align={'t'} + style={{ marginRight: 5 }} + triggerType={'hover'} + > + + {aliwareIntl.get( + 'nacos.component.ImportDialog.You_can_only_upload._zip_file_format0' + ) /* 只能上传.zip格式的文件 */} + + + ); + const footer = ( +
+ { this.callback(args[0].retData, this.state.policyLabel); this.closeDialog(); - }} onError={(...args) => { + }} + onError={(...args) => { this.callback(args[0].response.retData, this.state.policyLabel); this.closeDialog(); - }} formatter={this.formatter.bind(this)} headers={{ poweredBy: "simpleMVC", projectName: "nacos" }}> - -
; + }} + formatter={this.formatter} + headers={{ poweredBy: 'simpleMVC', projectName: 'nacos' }} + > + +
+
+ ); - return
- -
- -

{this.state.tenant.name}{" | " + this.state.tenant.id} -

-
- - - -
+ return ( +
+ +
+ +

+ {this.state.tenant.name} + {` | ${this.state.tenant.id}`} +

+
+ + + + + + + +
+
- - - - - - - - - -
- -
- ); - } +
+ ); + } } -/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/ -export default NewNameSpace; \ No newline at end of file + +export default NewNameSpace; diff --git a/console/src/main/resources/static/src/components/NewNameSpace/index.js b/console/src/main/resources/static/src/components/NewNameSpace/index.js index 09b5cb99e..7566e167a 100644 --- a/console/src/main/resources/static/src/components/NewNameSpace/index.js +++ b/console/src/main/resources/static/src/components/NewNameSpace/index.js @@ -13,4 +13,4 @@ import NewNameSpace from './NewNameSpace'; -export default NewNameSpace; \ No newline at end of file +export default NewNameSpace; diff --git a/console/src/main/resources/static/src/components/RegionGroup/RegionGroup.js b/console/src/main/resources/static/src/components/RegionGroup/RegionGroup.js index 1c33d0159..32a1ef1c1 100644 --- a/console/src/main/resources/static/src/components/RegionGroup/RegionGroup.js +++ b/console/src/main/resources/static/src/components/RegionGroup/RegionGroup.js @@ -12,261 +12,309 @@ */ import React from 'react'; +import PropTypes from 'prop-types'; import { Button } from '@alifd/next'; import $ from 'jquery'; import NameSpaceList from '../NameSpaceList'; import { setParams, request } from '../../globalLib'; import './index.less'; -/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/ class RegionGroup extends React.Component { - constructor(props) { - super(props); - this.state = { - instanceData: [], - currRegionId: '', - url: props.url || '/diamond-ops/env/domain', - left: props.left, - right: props.right, - regionWidth: 700, - hideRegionList: false - }; - this.currRegionId = ''; - this.styles = { - title: { - // marginTop: '8px', - // marginBottom: '8px', - margin: 0, - lineHeight: '32px', - display: 'inline-block', - textIndent: '8px', - marginRight: '8px', - borderLeft: '2px solid #88b7E0', - fontSize: '16px' - } - }; - this.nameSpaceList = null; - this.mainRef = null; - this.titleRef = null; - this.regionRef = null; - this.extraRef = null; - this.resizer = null; - this.timer = null; - this.handleResize = this.handleResize.bind(this); - this.handleAliyunNav = this.handleAliyunNav.bind(this); - !window.viewframeSetting && (window.viewframeSetting = {}); - } + static propTypes = { + url: PropTypes.string, + left: PropTypes.any, + right: PropTypes.any, + namespaceCallBack: PropTypes.func, + setNowNameSpace: PropTypes.func, + }; - componentDidMount() { - //this.setRegionWidth(); - // window.postMessage({ type: 'CONSOLE_HAS_REGION' }, window.location) - // $(".aliyun-console-regionbar").show(); - // $(window).bind("resize", this.handleResize); - // window.addEventListener("message", this.handleAliyunNav); + constructor(props) { + super(props); + this.state = { + instanceData: [], + currRegionId: '', + url: props.url || '/diamond-ops/env/domain', + left: props.left, + right: props.right, + regionWidth: 700, + hideRegionList: false, + }; + this.currRegionId = ''; + this.styles = { + title: { + // marginTop: '8px', + // marginBottom: '8px', + margin: 0, + lineHeight: '32px', + display: 'inline-block', + textIndent: '8px', + marginRight: '8px', + borderLeft: '2px solid #88b7E0', + fontSize: '16px', + }, + }; + this.nameSpaceList = null; + this.mainRef = null; + this.titleRef = null; + this.regionRef = null; + this.extraRef = null; + this.resizer = null; + this.timer = null; + this.handleResize = this.handleResize.bind(this); + this.handleAliyunNav = this.handleAliyunNav.bind(this); + !window.viewframeSetting && (window.viewframeSetting = {}); + } + + componentDidMount() { + // this.setRegionWidth(); + // window.postMessage({ type: 'CONSOLE_HAS_REGION' }, window.location) + // $(".aliyun-console-regionbar").show(); + // $(window).bind("resize", this.handleResize); + // window.addEventListener("message", this.handleAliyunNav); + // this.getRegionList(); + // setTimeout(() => { + // this.setRegionWidth(); + // this.handleRegionListStatus(); + // }); + this.nameSpaceList && this.nameSpaceList.getNameSpaces(); + } + + componentWillUnmount() { + $(window).unbind('resize', this.handleResize); + window.postMessage({ type: 'CONSOLE_HIDE_REGION' }, window.location); + $('.aliyun-console-regionbar').hide(); + } + + UNSAFE_componentWillReceiveProps(nextProps) { + this.setState({ + url: nextProps.url, + left: nextProps.left, + right: nextProps.right, + }); + } + + handleAliyunNav(event = {}) { + const { type, payload } = (event && event.data) || {}; + + switch (type) { + case 'TOPBAR_SIDEBAR_DID_MOUNT': // this.getRegionList(); - // setTimeout(() => { - // this.setRegionWidth(); - // this.handleRegionListStatus(); - // }); - this.nameSpaceList && this.nameSpaceList.getNameSpaces(); - } - componentWillUnmount() { - $(window).unbind('resize', this.handleResize); - window.postMessage({ type: 'CONSOLE_HIDE_REGION' }, window.location) - $(".aliyun-console-regionbar").hide(); - } - UNSAFE_componentWillReceiveProps(nextProps) { - this.setState({ - url: nextProps.url, - left: nextProps.left, - right: nextProps.right - }); - } - handleAliyunNav(event) { - const type = event.data.type; - const payload = event.data.payload; // { fromRegionId: 'xxx', toRegionId: 'xxx'' } - console.log(type, payload); - - switch (type) { - case "TOPBAR_SIDEBAR_DID_MOUNT": - // this.getRegionList(); - this.handleRegionListStatus(); - this.changeRegionBarRegionId(this.currRegionId); - setTimeout(() => { - this.changeRegionBarRegionId(this.currRegionId); - }, 1000); - break; - case "CONSOLE_REGION_CHANGE": - this.changeTableData(payload.toRegionId); - break; - default: - break; - } - } - handleRegionListStatus() { - const isPrivateClound = window.globalConfig && window.globalConfig.isParentEdas(); - this.setState({ - hideRegionList: isPrivateClound ? false : window.location.search.indexOf("hideTopbar=") === -1 - }, () => { - this.setRegionWidth(); - }); - } - handleResize() { - clearTimeout(this.timer); - this.timer = setTimeout(() => { - this.setRegionWidth(); - }, 100); - } - setRegionWidth() { - try { - let mainWidth = $(this.mainRef).width(); - let titleWidth = $(this.titleRef).width(); - let extraWidth = $(this.extraRef).width(); - let regionWidth = mainWidth - extraWidth - titleWidth - 50; - this.setState({ - regionWidth: regionWidth > 100 ? regionWidth : 100 - }); - } catch (error) { } - } - getRegionList() { - if (window._regionList) { - console.log('...'); - this.handleRegionList(window._regionList); - } else { - // TODO - this.nameSpaceList && this.nameSpaceList.getNameSpaces(); - - request({ - url: this.state.url, - data: {}, - success: res => { - //this.loading(false); - if (res && res.data) { - window._regionList = res.data; - this.handleRegionList(res.data); - } - } - }); - } - } - handleRegionList(data) { - let envcontent = ''; - let envGroups = data.envGroups; - let instanceData = []; - for (let i = 0; i < envGroups.length; i++) { - let obj = envGroups[i].envs || []; - instanceData = obj; - for (let j = 0; j < obj.length; j++) { - if (obj[j].active) { - envcontent = obj[j].serverId; - } - } - } - - this.currRegionId = envcontent || instanceData[0] && instanceData[0].serverId; - setParams("serverId", this.currRegionId); - - this.setRegionBarRegionList(instanceData, this.currRegionId); + this.handleRegionListStatus(); this.changeRegionBarRegionId(this.currRegionId); setTimeout(() => { - this.changeRegionBarRegionId(this.currRegionId); + this.changeRegionBarRegionId(this.currRegionId); }, 1000); - this.nameSpaceList && this.nameSpaceList.getNameSpaces(); - this.setState({ - currRegionId: envcontent, - instanceData: instanceData - }); + break; + case 'CONSOLE_REGION_CHANGE': + this.changeTableData(payload.toRegionId); + break; + default: + break; } - changeTableData(serverId) { - console.log(serverId); - console.log(this.state.currRegionId); - setParams("serverId", serverId); - if (this.state.currRegionId === serverId) { - return; - } - this.currRegionId = serverId; - let instanceData = this.state.instanceData, - inEdas = false; - if (window.globalConfig.isParentEdas()) { - inEdas = true; + } + + handleRegionListStatus() { + const isPrivateClound = window.globalConfig && window.globalConfig.isParentEdas(); + this.setState( + { + hideRegionList: isPrivateClound + ? false + : window.location.search.indexOf('hideTopbar=') === -1, + }, + () => { + this.setRegionWidth(); + } + ); + } + + handleResize() { + clearTimeout(this.timer); + this.timer = setTimeout(() => { + this.setRegionWidth(); + }, 100); + } + + setRegionWidth() { + try { + const mainWidth = $(this.mainRef).width(); + const titleWidth = $(this.titleRef).width(); + const extraWidth = $(this.extraRef).width(); + const regionWidth = mainWidth - extraWidth - titleWidth - 50; + this.setState({ + regionWidth: regionWidth > 100 ? regionWidth : 100, + }); + } catch (error) {} + } + + getRegionList() { + if (window._regionList) { + this.handleRegionList(window._regionList); + } else { + // TODO + this.nameSpaceList && this.nameSpaceList.getNameSpaces(); + + request({ + url: this.state.url, + data: {}, + success: res => { + if (res && res.data) { + window._regionList = res.data; + this.handleRegionList(res.data); + } + }, + }); + } + } + + handleRegionList(data = {}) { + let envcontent = ''; + const { envGroups } = data; + let instanceData = []; + for (let i = 0; i < envGroups.length; i++) { + const obj = envGroups[i].envs || []; + instanceData = obj; + for (let j = 0; j < obj.length; j++) { + if (obj[j].active) { + envcontent = obj[j].serverId; } + } + } - instanceData.forEach(obj => { - if (obj.serverId === serverId) { - let lastHash = window.location.hash.split("?")[0]; - if (inEdas) { - setParams("serverId", obj.serverId); - // setParams('regionId', obj.serverId); - let url = window.location.href; + this.currRegionId = envcontent || (instanceData[0] && instanceData[0].serverId); + setParams('serverId', this.currRegionId); - console.log("url: ", url); - window.location.href = url; - } else { - let url = obj.domain + window.location.search + lastHash; - if (lastHash.indexOf('serverId') === -1) { - if (lastHash.indexOf('?') === -1) { - url += '?serverId=' + serverId; - } else { - url += '&serverId=' + serverId; - } - } - window.location.href = window.location.protocol + '//' + url; - } + this.setRegionBarRegionList(instanceData, this.currRegionId); + this.changeRegionBarRegionId(this.currRegionId); + setTimeout(() => { + this.changeRegionBarRegionId(this.currRegionId); + }, 1000); + this.nameSpaceList && this.nameSpaceList.getNameSpaces(); + this.setState({ + currRegionId: envcontent, + instanceData, + }); + } - return; + changeTableData(serverId) { + setParams('serverId', serverId); + if (this.state.currRegionId === serverId) { + return; + } + this.currRegionId = serverId; + const { instanceData } = this.state; + + let inEdas = false; + if (window.globalConfig.isParentEdas()) { + inEdas = true; + } + + instanceData.forEach(obj => { + if (obj.serverId === serverId) { + const lastHash = window.location.hash.split('?')[0]; + if (inEdas) { + setParams('serverId', obj.serverId); + const url = window.location.href; + window.location.href = url; + } else { + let url = obj.domain + window.location.search + lastHash; + if (lastHash.indexOf('serverId') === -1) { + if (lastHash.indexOf('?') === -1) { + url += `?serverId=${serverId}`; + } else { + url += `&serverId=${serverId}`; } - }); - //window.location.href = ''; - // return; - // setParams("serverId", serverId); - // this.setState({ - // currRegionId: serverId - // }); - // this.currRegionId = serverId; - // this.props.onChange && this.props.onChange({ - // instanceData: this.state.instanceData, - // currRegionId: serverId - // }) - } - setRegionBarRegionList(regionList, regionId) { - // regionList = [{ - // serverId: "cn-hangzhou", - // }, { - // serverId: "cn-shenzhen", - // }] - // if (!window.viewframeSetting.regionList || window.viewframeSetting.regionList.length === 0) { - if (window.viewframeSetting) { - window.viewframeSetting.regionList = regionList; - window.postMessage({ type: 'TOGGLE_REGIONBAR_STATUS', payload: { regionList: regionList, defaultRegionId: regionId } }, window.location); + } + window.location.href = `${window.location.protocol}//${url}`; } - } - changeRegionBarRegionId(regionId) { - window.viewframeSetting && (window.viewframeSetting.defaultRegionId = regionId); - window.postMessage({ type: 'SET_ACTIVE_REGION_ID', payload: { defaultRegionId: regionId } }, window.location); - } - render() { + } + }); + } - return
-
this.mainRef = ref} className="clearfix" > -
-
-
this.titleRef = ref} style={{ display: 'inline-block', verticalAlign: 'top' }}> - {typeof this.state.left === 'string' ?
{this.state.left}
: this.state.left} -
- {this.state.hideRegionList ? null :
this.regionRef = ref} style={{ width: this.state.regionWidth, display: 'inline-block', lineHeight: '40px', marginLeft: 20 }}> - {this.state.instanceData.map((val, key) => { - return ; - })} -
} -
-
this.extraRef = ref} style={{ float: 'right', display: 'inline-block', paddingTop: 6 }}> - {Object.prototype.toString.call(this.state.right) === '[object Function]' ? this.state.right() : this.state.right} -
-
- {this.props.namespaceCallBack ?
this.nameSpaceList = ref} namespaceCallBack={this.props.namespaceCallBack} setNowNameSpace={this.props.setNowNameSpace} />
: null} -
-
; + setRegionBarRegionList(regionList, regionId) { + if (window.viewframeSetting) { + window.viewframeSetting.regionList = regionList; + window.postMessage( + { type: 'TOGGLE_REGIONBAR_STATUS', payload: { regionList, defaultRegionId: regionId } }, + window.location + ); } + } + + changeRegionBarRegionId(regionId) { + window.viewframeSetting && (window.viewframeSetting.defaultRegionId = regionId); + window.postMessage( + { type: 'SET_ACTIVE_REGION_ID', payload: { defaultRegionId: regionId } }, + window.location + ); + } + + render() { + return ( +
+
(this.mainRef = ref)} className="clearfix"> +
+
+
(this.titleRef = ref)} + style={{ display: 'inline-block', verticalAlign: 'top' }} + > + {typeof this.state.left === 'string' ? ( +
{this.state.left}
+ ) : ( + this.state.left + )} +
+ {this.state.hideRegionList ? null : ( +
(this.regionRef = ref)} + style={{ + width: this.state.regionWidth, + display: 'inline-block', + lineHeight: '40px', + marginLeft: 20, + }} + > + {this.state.instanceData.map((val, key) => ( + + ))} +
+ )} +
+
(this.extraRef = ref)} + style={{ float: 'right', display: 'inline-block', paddingTop: 6 }} + > + {Object.prototype.toString.call(this.state.right) === '[object Function]' + ? this.state.right() + : this.state.right} +
+
+ {this.props.namespaceCallBack ? ( +
+ (this.nameSpaceList = ref)} + namespaceCallBack={this.props.namespaceCallBack} + setNowNameSpace={this.props.setNowNameSpace} + /> +
+ ) : null} +
+
+ ); + } } -/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/ -export default RegionGroup; \ No newline at end of file + +export default RegionGroup; diff --git a/console/src/main/resources/static/src/components/RegionGroup/index.js b/console/src/main/resources/static/src/components/RegionGroup/index.js index b4a93b42e..d3495690f 100644 --- a/console/src/main/resources/static/src/components/RegionGroup/index.js +++ b/console/src/main/resources/static/src/components/RegionGroup/index.js @@ -13,4 +13,4 @@ import RegionGroup from './RegionGroup'; -export default RegionGroup; \ No newline at end of file +export default RegionGroup; diff --git a/console/src/main/resources/static/src/components/ShowCodeing/ShowCodeing.js b/console/src/main/resources/static/src/components/ShowCodeing/ShowCodeing.js index 799d253c2..22742850b 100644 --- a/console/src/main/resources/static/src/components/ShowCodeing/ShowCodeing.js +++ b/console/src/main/resources/static/src/components/ShowCodeing/ShowCodeing.js @@ -15,23 +15,24 @@ import React from 'react'; import './index.less'; import { getParams, aliwareIntl } from '../../globalLib'; import { Dialog, Loading, Tab } from '@alifd/next'; + const TabPane = Tab.Item; -/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/ + class ShowCodeing extends React.Component { - constructor(props) { - super(props); - this.state = { - dialogvisible: false, - loading: false - }; - this.defaultCode = ``; - this.nodejsCode = `TODO`; - this.cppCode = `TODO`; - this.shellCode = `TODO`; - this.pythonCode = `TODO`; - this.record = {}; - this.sprigboot_code = `// Refer to document: https://github.com/nacos-group/nacos-examples/tree/master/nacos-spring-boot-example/nacos-spring-boot-config-example + constructor(props) { + super(props); + this.state = { + dialogvisible: false, + loading: false, + }; + this.defaultCode = ''; + this.nodejsCode = 'TODO'; + this.cppCode = 'TODO'; + this.shellCode = 'TODO'; + this.pythonCode = 'TODO'; + this.record = {}; + this.sprigboot_code = `// Refer to document: https://github.com/nacos-group/nacos-examples/tree/master/nacos-spring-boot-example/nacos-spring-boot-config-example package com.alibaba.nacos.example.spring.boot.controller; import org.springframework.beans.factory.annotation.Value; @@ -58,7 +59,7 @@ public class ConfigController { return useLocalCache; } }`; - this.sprigcloud_code = `// Refer to document: https://github.com/nacos-group/nacos-examples/tree/master/nacos-spring-cloud-example/nacos-spring-cloud-config-example + this.sprigcloud_code = `// Refer to document: https://github.com/nacos-group/nacos-examples/tree/master/nacos-spring-cloud-example/nacos-spring-cloud-config-example package com.alibaba.nacos.example.spring.cloud.controller; import org.springframework.beans.factory.annotation.Value; @@ -79,39 +80,41 @@ public class ConfigController { return useLocalCache; } }`; - } + } - componentDidMount() { } - openLoading() { - this.setState({ - loading: true - }); - } - closeLoading() { - this.setState({ - loading: false - }); - } + componentDidMount() { } - getData() { - let namespace = getParams('namespace'); //获取ak,sk - let obj = { - group: this.record.group || '', - dataId: this.record.dataId || '', - namespace: namespace, - inEdas: window.globalConfig.isParentEdas() - }; - this.defaultCode = this.getJavaCode(obj); - this.createCodeMirror('text/x-java', this.defaultCode); - this.nodejsCode = this.getNodejsCode(obj); - this.cppCode = this.getCppCode(obj); - this.shellCode = this.getShellCode(obj); - this.pythonCode = this.getPythonCode(obj); - this.forceUpdate(); - } + openLoading() { + this.setState({ + loading: true, + }); + } - getJavaCode(data) { - return `/* + closeLoading() { + this.setState({ + loading: false, + }); + } + + getData() { + const namespace = getParams('namespace'); // 获取ak,sk + const obj = { + group: this.record.group || '', + dataId: this.record.dataId || '', + namespace, + inEdas: window.globalConfig.isParentEdas(), + }; + this.defaultCode = this.getJavaCode(obj); + this.createCodeMirror('text/x-java', this.defaultCode); + this.nodejsCode = this.getNodejsCode(obj); + this.cppCode = this.getCppCode(obj); + this.shellCode = this.getShellCode(obj); + this.pythonCode = this.getPythonCode(obj); + this.forceUpdate(); + } + + getJavaCode(data) { + return `/* * Demo for Nacos * pom.xml @@ -176,115 +179,108 @@ public class ConfigExample { } } `; + } + + getNodejsCode(data) { + return 'TODO'; + } + + getCppCode(data) { + return 'TODO'; + } + + getShellCode(data) { + return 'TODO'; + } + + getPythonCode(data) { + return 'TODO'; + } + + openDialog(record) { + this.setState({ + dialogvisible: true, + }); + this.record = record; + setTimeout(() => { + this.getData(); // 获取数据 + }); + } + + closeDialog() { + this.setState({ + dialogvisible: false, + }); + } + + createCodeMirror(mode, value) { + const commontarget = this.refs.codepreview; + if (commontarget) { + commontarget.innerHTML = ''; + this.cm = window.CodeMirror(commontarget, { + value, + mode, + height: 400, + width: 500, + lineNumbers: true, + theme: 'xq-light', + lint: true, + tabMode: 'indent', + autoMatchParens: true, + textWrapping: true, + gutters: ['CodeMirror-lint-markers'], + extraKeys: { + F1(cm) { + cm.setOption('fullScreen', !cm.getOption('fullScreen')); + }, + Esc(cm) { + if (cm.getOption('fullScreen')) cm.setOption('fullScreen', false); + }, + }, + }); } - getNodejsCode(data) { - return `TODO`; - } + // this.cm.setSize(window.innerWidth*0.8-10,400);//设置宽高 + } - getCppCode(data) { - return `TODO`; - } + changeTab(key, code) { + setTimeout(() => { + this[key] = true; - getShellCode(data) { - return `TODO`; - } + this.createCodeMirror('text/javascript', code); + }); + } - getPythonCode(data) { - return `TODO`; - } + render() { + const footer =
; + return ( +
+ +
+ + + + - openDialog(record) { - this.setState({ - dialogvisible: true - }); - this.record = record; - setTimeout(() => { + - this.getData(); //获取数据 - }); - } + - closeDialog() { - this.setState({ - dialogvisible: false - }); - } + - createCodeMirror(mode, value) { - let commontarget = this.refs['codepreview']; - if (commontarget) { - commontarget.innerHTML = ''; - this.cm = window.CodeMirror(commontarget, { - value: value, - mode: mode, - height: 400, - width: 500, - lineNumbers: true, - theme: 'xq-light', - lint: true, - tabMode: "indent", - autoMatchParens: true, - textWrapping: true, - gutters: ["CodeMirror-lint-markers"], - extraKeys: { - "F1": function (cm) { - cm.setOption("fullScreen", !cm.getOption("fullScreen")); - }, - "Esc": function (cm) { - if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false); - } - } - }); - } + - //this.cm.setSize(window.innerWidth*0.8-10,400);//设置宽高 - } - changeTab(key, code) { - setTimeout(() => { - this[key] = true; + + {} + +
+ +
+
- this.createCodeMirror('text/javascript', code); - }); - } - render() { - const footer =
; - return ( -
- -
- - - - - - - - - - - - - - - - - - - - - - - {} - -
-
-
-
- -
- ); - } +
+ ); + } } -/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/ -export default ShowCodeing; \ No newline at end of file + +export default ShowCodeing; diff --git a/console/src/main/resources/static/src/components/ShowCodeing/index.js b/console/src/main/resources/static/src/components/ShowCodeing/index.js index 732fd0f1d..8183e94fc 100644 --- a/console/src/main/resources/static/src/components/ShowCodeing/index.js +++ b/console/src/main/resources/static/src/components/ShowCodeing/index.js @@ -13,4 +13,4 @@ import ShowCodeing from './ShowCodeing'; -export default ShowCodeing; \ No newline at end of file +export default ShowCodeing; diff --git a/console/src/main/resources/static/src/components/SuccessDialog/SuccessDialog.js b/console/src/main/resources/static/src/components/SuccessDialog/SuccessDialog.js index 6279bf0a4..e740c422a 100644 --- a/console/src/main/resources/static/src/components/SuccessDialog/SuccessDialog.js +++ b/console/src/main/resources/static/src/components/SuccessDialog/SuccessDialog.js @@ -12,83 +12,111 @@ */ import React from 'react'; +import PropTypes from 'prop-types'; import { aliwareIntl } from '../../globalLib'; import './index.less'; import { Button, Dialog, Grid, Icon } from '@alifd/next'; + const { Row, Col } = Grid; -/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/ class SuccessDialog extends React.Component { - constructor(props) { - super(props); - this.state = { - visible: false, - title: aliwareIntl.get('com.alibaba.nacos.component.SuccessDialog.Configuration_management'), - maintitle: '', - content: '', - isok: true, - dataId: '', - group: '' + static propTypes = { + unpushtrace: PropTypes.bool, + }; - }; - } + constructor(props) { + super(props); + this.state = { + visible: false, + title: aliwareIntl.get('com.alibaba.nacos.component.SuccessDialog.Configuration_management'), + maintitle: '', + content: '', + isok: true, + dataId: '', + group: '', + }; + } - componentDidMount() { } - openDialog(payload) { - if (this.props.unpushtrace) { - payload.title = ''; - } - this.setState({ - visible: true, - maintitle: payload.maintitle, - title: payload.title, - content: payload.content, - isok: payload.isok, - dataId: payload.dataId, - group: payload.group, - message: payload.message - }); + componentDidMount() {} + + openDialog(_payload) { + let payload = _payload; + if (this.props.unpushtrace) { + payload.title = ''; } - closeDialog() { - this.setState({ - visible: false - }); - } - render() { - const footer =
; - return
- + this.setState({ + visible: true, + maintitle: payload.maintitle, + title: payload.title, + content: payload.content, + isok: payload.isok, + dataId: payload.dataId, + group: payload.group, + message: payload.message, + }); + } + + closeDialog() { + this.setState({ + visible: false, + }); + } + + render() { + const footer = ( +
+ +
+ ); + return ( +
+ +
+ + + {this.state.isok ? ( + + ) : ( + + )} + +
- - - {this.state.isok ? : } - - - -
- {this.state.isok ?

{this.state.title}

:

{this.state.title} {aliwareIntl.get('com.alibaba.nacos.component.SuccessDialog.failure')}

} -

- Data ID: - - {this.state.dataId} - -

-

- Group: - - {this.state.group} - -

- {this.state.isok ? '' :

{this.state.message}

} -
- -
- + {this.state.isok ? ( +

{this.state.title}

+ ) : ( +

+ {this.state.title}{' '} + {aliwareIntl.get('com.alibaba.nacos.component.SuccessDialog.failure')} +

+ )} +

+ Data ID: + {this.state.dataId} +

+

+ Group: + {this.state.group} +

+ {this.state.isok ? '' :

{this.state.message}

}
-
- -
; - } + + +
+ +
+ ); + } } -/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/ -export default SuccessDialog; \ No newline at end of file + +export default SuccessDialog; diff --git a/console/src/main/resources/static/src/components/SuccessDialog/index.js b/console/src/main/resources/static/src/components/SuccessDialog/index.js index ed8d3ff61..ed9f8be60 100644 --- a/console/src/main/resources/static/src/components/SuccessDialog/index.js +++ b/console/src/main/resources/static/src/components/SuccessDialog/index.js @@ -13,4 +13,4 @@ import SuccessDialog from './SuccessDialog'; -export default SuccessDialog; \ No newline at end of file +export default SuccessDialog; diff --git a/console/src/main/resources/static/src/config.js b/console/src/main/resources/static/src/config.js index 1e7d51ea9..f98bf3ba8 100644 --- a/console/src/main/resources/static/src/config.js +++ b/console/src/main/resources/static/src/config.js @@ -12,129 +12,129 @@ */ module.exports = { - server: '', - PAGESIZE: 15, - TIMERDEFAULT: '5s', - TIMEDURINT: 2000, - is_preview: process.env.NODE_ENV === 'development', - projectName: 'nacos', - defaultLanguage: 'zh-cn', - 'en-us': { - pageMenu: [ - { - key: 'home', // 用作顶部菜单的选中 - text: 'HOME', - link: 'https://nacos.io/en-us/index.html', - }, - { - key: 'docs', - text: 'DOCS', - link: 'https://nacos.io/en-us/docs/quick-start.html', - }, - { - key: 'blog', - text: 'BLOG', - link: 'https://nacos.io/en-us/blog', - }, - { - key: 'community', - text: 'COMMUNITY', - link: 'https://nacos.io/en-us/community', - }, - // { - // text: 'ALI-SUPPORT', - // href: 'https://developer.aliyun.com/opensource/project/nacos', - // }, - ], - disclaimer: { - title: 'Vision', - content: 'By providing an easy-to-use service infrastructure such as dynamic service discovery, service configuration, service sharing and management and etc., Nacos help users better construct, deliver and manage their own service platform, reuse and composite business service faster and deliver value of business innovation more quickly so as to win market for users in the era of cloud native and in all cloud environments, such as private, mixed, or public clouds.', - }, - documentation: { - title: 'Documentation', - list: [ - { - text: 'Overview', - link: '/en-us/docs/what-is-nacos.html', - }, - { - text: 'Quick start', - link: '/en-us/docs/quick-start.html', - }, - { - text: 'Developer guide', - link: '/en-us/docs/contributing.html', - }, - ], - }, - resources: { - title: 'Resources', - list: [ - { - text: 'Community', - link: '/en-us/community/index.html', - }, - ], - }, - copyright: '@ 2018 The Nacos Authors | An Alibaba Middleware (Aliware) Project', + server: '', + PAGESIZE: 15, + TIMERDEFAULT: '5s', + TIMEDURINT: 2000, + is_preview: process.env.NODE_ENV === 'development', + projectName: 'nacos', + defaultLanguage: 'zh-cn', + 'en-us': { + pageMenu: [ + { + key: 'home', // 用作顶部菜单的选中 + text: 'HOME', + link: 'https://nacos.io/en-us/index.html', + }, + { + key: 'docs', + text: 'DOCS', + link: 'https://nacos.io/en-us/docs/quick-start.html', + }, + { + key: 'blog', + text: 'BLOG', + link: 'https://nacos.io/en-us/blog', + }, + { + key: 'community', + text: 'COMMUNITY', + link: 'https://nacos.io/en-us/community', + }, + // { + // text: 'ALI-SUPPORT', + // href: 'https://developer.aliyun.com/opensource/project/nacos', + // }, + ], + disclaimer: { + title: 'Vision', + content: 'By providing an easy-to-use service infrastructure such as dynamic service discovery, service configuration, service sharing and management and etc., Nacos help users better construct, deliver and manage their own service platform, reuse and composite business service faster and deliver value of business innovation more quickly so as to win market for users in the era of cloud native and in all cloud environments, such as private, mixed, or public clouds.', }, - 'zh-cn': { - pageMenu: [ - { - key: 'home', - text: '首页', - link: 'https://nacos.io/zh-cn/', - }, - { - key: 'docs', - text: '文档', - link: 'https://nacos.io/zh-cn/docs/what-is-nacos.html', - }, - { - key: 'blog', - text: '博客', - link: 'https://nacos.io/zh-cn/blog/index.html', - }, - { - key: 'community', - text: '社区', - link: 'https://nacos.io/zh-cn/community/index.html', - }, - // { - // text: '阿里开发者中心', - // href: 'https://developer.aliyun.com/opensource/project/nacos', - // }, - ], - disclaimer: { - title: '愿景', - content: 'Nacos 通过提供简单易用的动态服务发现、服务配置、服务共享与管理等服务基础设施,帮助用户在云原生时代,在私有云、混合云或者公有云等所有云环境中,更好的构建、交付、管理自己的微服务平台,更快的复用和组合业务服务,更快的交付商业创新的价值,从而为用户赢得市场。', + documentation: { + title: 'Documentation', + list: [ + { + text: 'Overview', + link: '/en-us/docs/what-is-nacos.html', }, - documentation: { - title: '文档', - list: [ - { - text: '概览', - link: '/zh-cn/docs/what-is-nacos.html', - }, - { - text: '快速开始', - link: '/zh-cn/docs/quick-start.html', - }, - { - text: '开发者指南', - link: '/zh-cn/docs/contributing.html', - }, - ], + { + text: 'Quick start', + link: '/en-us/docs/quick-start.html', }, - resources: { - title: '资源', - list: [ - { - text: '社区', - link: '/zh-cn/community/index.html', - }, - ], + { + text: 'Developer guide', + link: '/en-us/docs/contributing.html', }, - copyright: '@ 2018 The Nacos Authors | An Alibaba Middleware (Aliware) Project', + ], }, -} \ No newline at end of file + resources: { + title: 'Resources', + list: [ + { + text: 'Community', + link: '/en-us/community/index.html', + }, + ], + }, + copyright: '@ 2018 The Nacos Authors | An Alibaba Middleware (Aliware) Project', + }, + 'zh-cn': { + pageMenu: [ + { + key: 'home', + text: '首页', + link: 'https://nacos.io/zh-cn/', + }, + { + key: 'docs', + text: '文档', + link: 'https://nacos.io/zh-cn/docs/what-is-nacos.html', + }, + { + key: 'blog', + text: '博客', + link: 'https://nacos.io/zh-cn/blog/index.html', + }, + { + key: 'community', + text: '社区', + link: 'https://nacos.io/zh-cn/community/index.html', + }, + // { + // text: '阿里开发者中心', + // href: 'https://developer.aliyun.com/opensource/project/nacos', + // }, + ], + disclaimer: { + title: '愿景', + content: 'Nacos 通过提供简单易用的动态服务发现、服务配置、服务共享与管理等服务基础设施,帮助用户在云原生时代,在私有云、混合云或者公有云等所有云环境中,更好的构建、交付、管理自己的微服务平台,更快的复用和组合业务服务,更快的交付商业创新的价值,从而为用户赢得市场。', + }, + documentation: { + title: '文档', + list: [ + { + text: '概览', + link: '/zh-cn/docs/what-is-nacos.html', + }, + { + text: '快速开始', + link: '/zh-cn/docs/quick-start.html', + }, + { + text: '开发者指南', + link: '/zh-cn/docs/contributing.html', + }, + ], + }, + resources: { + title: '资源', + list: [ + { + text: '社区', + link: '/zh-cn/community/index.html', + }, + ], + }, + copyright: '@ 2018 The Nacos Authors | An Alibaba Middleware (Aliware) Project', + }, +}; diff --git a/console/src/main/resources/static/src/containers/App.js b/console/src/main/resources/static/src/containers/App.js index da5cc55c6..d489aedcb 100644 --- a/console/src/main/resources/static/src/containers/App.js +++ b/console/src/main/resources/static/src/containers/App.js @@ -23,66 +23,69 @@ import _menu from '../menu'; import { nacosEvent } from '../globalLib'; class App extends Component { + constructor(props) { + super(props); + this.state = { + shownotice: 'none', + noticecontent: '', + nacosLoading: {}, + }; + } - constructor(props) { - super(props); - this.state = { - shownotice: 'none', - noticecontent: '', - nacosLoading: {} - } - } - componentDidMount() { - //监听loading事件 - nacosEvent.listenAllTask("nacosLoadingEvent", (nacosLoading) => { - this.setState({ - nacosLoading - }) - }); - } - UNSAFE_componentWillUpdate(nextProps, nextState) { - const { errcode, errinfo } = nextProps; - if (errcode === 1) { - this.openErr(errinfo); - } - } + componentDidMount() { + // 监听loading事件 + nacosEvent.listenAllTask('nacosLoadingEvent', (nacosLoading) => { + this.setState({ + nacosLoading, + }); + }); + } - componentWillUnmount() { - nacosEvent.remove("nacosLoadingEvent"); + UNSAFE_componentWillUpdate(nextProps, nextState) { + const { errcode, errinfo } = nextProps; + if (errcode === 1) { + this.openErr(errinfo); } + } - openErr(message) { - const self = this; - setTimeout(function () { - self.props.dispatch({ type: 'error/clear' }) - }, 3000); - } - getChildContext() { - return { history: this.props.history }; - } - render() { - const { errcode, errinfo } = this.props; - return ( - - - {errcode === 1 ? : null} - {this.props.children} - - ) - } + componentWillUnmount() { + nacosEvent.remove('nacosLoadingEvent'); + } + + openErr(message) { + const self = this; + setTimeout(() => { + self.props.dispatch({ type: 'error/clear' }); + }, 3000); + } + + getChildContext() { + return { history: this.props.history }; + } + + render() { + const { errcode, errinfo } = this.props; + return ( + + + {errcode === 1 ? : null} + {this.props.children} + + ); + } } App.propTypes = { }; App.childContextTypes = { - history: PropTypes.object + history: PropTypes.object, }; function mapStateToProps(state) { - const { errinfo, errcode } = state.error; - return { - errinfo, - errcode - }; + const { errinfo, errcode } = state.error; + return { + errinfo, + errcode, + }; } export default connect(mapStateToProps)(App); diff --git a/console/src/main/resources/static/src/globalLib.js b/console/src/main/resources/static/src/globalLib.js index 4cdbe3b0f..0ea3b29a9 100644 --- a/console/src/main/resources/static/src/globalLib.js +++ b/console/src/main/resources/static/src/globalLib.js @@ -16,596 +16,616 @@ import serviceConfig from './serviceMock'; import moment from 'moment'; import $ from 'jquery'; import i18DocObj from './i18ndoc'; + const global = window; /** * 获取cookie值 * @param {*String} keyName cookie名 */ -const aliwareGetCookieByKeyName = function (keyName) { - let result = ''; - let cookieList = document.cookie && document.cookie.split(';') || []; - cookieList.forEach((str) => { - let tmpList = str.split('=') || []; - if (tmpList[0].trim().indexOf(keyName) !== -1) { - result = tmpList[1]; - } - }) +const aliwareGetCookieByKeyName = function(keyName) { + let result = ''; + const cookieList = (document.cookie && document.cookie.split(';')) || []; + cookieList.forEach(str => { + const [name = '', value = ''] = str.split('=') || []; + if (name.trim().indexOf(keyName) !== -1) { + result = value; + } + }); - return result.trim(); + return result.trim(); }; -/** +/** * 监听事件对象 */ -const nacosEvent = (function (_global) { - let eventListObj = {}; - let ignoreEventListObj = {}; - return { - /** - * 只监听一次 - */ - once: function (eventName, callback) { - this.listen.call(this, eventName, callback, true); - }, - /** - * 监听事件 - */ - listen: function (eventName, callback, once = false) { - if (!eventName || !callback) { - return; - } - !eventListObj[eventName] && (eventListObj[eventName] = []); - eventListObj[eventName].push({ - callback: callback, - once: once - }); - }, - /** - * 监听事件, 之前未消费的消息也会进行触发 - */ - listenAllTask: function () { - const self = this; - const argsList = Array.prototype.slice.call(arguments); - const eventName = argsList[0]; +const nacosEvent = (function(_global) { + const eventListObj = {}; + const ignoreEventListObj = {}; + return { + /** + * 只监听一次 + */ + once(eventName, callback) { + this.listen.call(this, eventName, callback, true); + }, + /** + * 监听事件 + */ + listen(eventName, callback, once = false) { + if (!eventName || !callback) { + return; + } + !eventListObj[eventName] && (eventListObj[eventName] = []); + eventListObj[eventName].push({ + callback, + once, + }); + }, + /** + * 监听事件, 之前未消费的消息也会进行触发 + */ + listenAllTask(...args) { + const self = this; + const argsList = Array.prototype.slice.call(args); + const eventName = argsList[0]; - if (!eventName) { - return; - } - //监听事件 - self.listen.apply(self, argsList); + if (!eventName) { + return; + } + // 监听事件 + self.listen(...argsList); - //判断是否有未消费的消息 - if (ignoreEventListObj[eventName] && ignoreEventListObj[eventName].length > 0) { - const eventObj = ignoreEventListObj[eventName].pop(); - self.trigger.apply(eventObj.self, eventObj.argsList); - } - }, - /** - * 触发事件 - */ - trigger: function () { - const self = this; - let argsList = Array.prototype.slice.call(arguments); - const eventName = argsList.shift(); - //如果还没有订阅消息, 将其放到未消费队列里 - if (!eventListObj[eventName]) { - !ignoreEventListObj[eventName] && (ignoreEventListObj[eventName] = []); - ignoreEventListObj[eventName].push({ - argsList: Array.prototype.slice.call(arguments), - self - }) - return; - } + // 判断是否有未消费的消息 + if (ignoreEventListObj[eventName] && ignoreEventListObj[eventName].length > 0) { + const eventObj = ignoreEventListObj[eventName].pop(); + self.trigger.apply(eventObj.self, eventObj.argsList); + } + }, + /** + * 触发事件 + */ + trigger(...args) { + const self = this; + const argsList = Array.prototype.slice.call(args); + const eventName = argsList.shift(); + // 如果还没有订阅消息, 将其放到未消费队列里 + if (!eventListObj[eventName]) { + !ignoreEventListObj[eventName] && (ignoreEventListObj[eventName] = []); + ignoreEventListObj[eventName].push({ + argsList: Array.prototype.slice.call(args), + self, + }); + return; + } - let newList = []; - eventListObj[eventName].forEach(function (_obj, index) { - if (Object.prototype.toString.call(_obj.callback) !== "[object Function]") { - return; - } - _obj.callback.apply(self, argsList); - //删除只触发一次的事件 - if (!_obj.once) { - newList.push(_obj); - } - }) - eventListObj[eventName] = newList; - }, - /** - * 删除监听事件 - */ - remove: function (eventName, callback) { - if (!eventName || !eventListObj[eventName]) { - return; - } - if (!callback) { - eventListObj[eventName] = null; - } else { - let newList = []; - eventListObj[eventName].forEach(function (_obj, index) { - if (_obj.callback !== callback) { - newList.push(_obj); - } - }) - eventListObj[eventName] = newList.length ? newList : null; - } + const newList = []; + eventListObj[eventName].forEach((_obj, index) => { + if (Object.prototype.toString.call(_obj.callback) !== '[object Function]') { + return; } - } + _obj.callback.apply(self, argsList); + // 删除只触发一次的事件 + if (!_obj.once) { + newList.push(_obj); + } + }); + eventListObj[eventName] = newList; + }, + /** + * 删除监听事件 + */ + remove(eventName, callback) { + if (!eventName || !eventListObj[eventName]) { + return; + } + if (!callback) { + eventListObj[eventName] = null; + } else { + const newList = []; + eventListObj[eventName].forEach((_obj, index) => { + if (_obj.callback !== callback) { + newList.push(_obj); + } + }); + eventListObj[eventName] = newList.length ? newList : null; + } + }, + }; })(global); /** * nacos的工具类 */ -const nacosUtils = (function (_global) { - let loadingCount = 0; - let loadingState = { - visible: false, - shape: "flower", - tip: "loading...", - // color: "#333", - // style: { height: "100%", width: "100%" } - } - return { - /** - * 改变loading 的样式 - */ - changeLoadingAttr: function (obj) { - if (Object.prototype.toString.call(obj) === "[object Object]") { - loadingState = Object.assign({}, loadingCount, obj); - } - }, - /** - * 打开loading效果 - */ - openLoading: function () { - loadingCount++; - nacosEvent.trigger("nacosLoadingEvent", Object.assign(loadingState, { - visible: true, - spinning: true - })) - }, - /** - * 尝试关闭loading, 只有当loadingCount小于0时才会关闭loading效果 - */ - closeLoading: function () { - loadingCount--; - if (loadingCount <= 0) { - loadingCount = 0; - nacosEvent.trigger("nacosLoadingEvent", Object.assign(loadingState, { - visible: false, - spinning: false - })); - } - }, - /** - * 关闭loading效果 - */ - closeAllLoading: function () { - loadingCount = 0; - nacosEvent.trigger("nacosLoadingEvent", Object.assign(loadingState, { - visible: false, - spinning: false - })); - }, - /** - * 获取资源地址, 如果资源需要静态化输出 请调用此方法 - */ - getURISource: function (url) { - return url; - } - } +const nacosUtils = (function(_global) { + let loadingCount = 0; + let loadingState = { + visible: false, + shape: 'flower', + tip: 'loading...', + // color: "#333", + // style: { height: "100%", width: "100%" } + }; + return { + /** + * 改变loading 的样式 + */ + changeLoadingAttr(obj) { + if (Object.prototype.toString.call(obj) === '[object Object]') { + loadingState = Object.assign({}, loadingCount, obj); + } + }, + /** + * 打开loading效果 + */ + openLoading() { + loadingCount++; + nacosEvent.trigger( + 'nacosLoadingEvent', + Object.assign(loadingState, { + visible: true, + spinning: true, + }) + ); + }, + /** + * 尝试关闭loading, 只有当loadingCount小于0时才会关闭loading效果 + */ + closeLoading() { + loadingCount--; + if (loadingCount <= 0) { + loadingCount = 0; + nacosEvent.trigger( + 'nacosLoadingEvent', + Object.assign(loadingState, { + visible: false, + spinning: false, + }) + ); + } + }, + /** + * 关闭loading效果 + */ + closeAllLoading() { + loadingCount = 0; + nacosEvent.trigger( + 'nacosLoadingEvent', + Object.assign(loadingState, { + visible: false, + spinning: false, + }) + ); + }, + /** + * 获取资源地址, 如果资源需要静态化输出 请调用此方法 + */ + getURISource(url) { + return url; + }, + }; })(global); -const aliwareIntl = (function (_global) { - /** - * 国际化构造方法 - * @param {Object} options 配置信息 - */ - function aliwareI18n(options) { - // let currentLocal = options.currentLocal || navigator.language || navigator.userLanguage; +const aliwareIntl = (function(_global) { + /** + * 国际化构造方法 + * @param {Object} options 配置信息 + */ + function AliwareI18n(options) { + // let currentLocal = options.currentLocal || navigator.language || navigator.userLanguage; - let nowData = options.locals; - this.nowData = nowData; - this.setMomentLocale(this.currentLanguageCode); + const nowData = options.locals; + this.nowData = nowData; + this.setMomentLocale(this.currentLanguageCode); + } + let aliwareLocal = aliwareGetCookieByKeyName('aliyun_lang') || 'zh'; + let aliwareLocalSite = aliwareGetCookieByKeyName('aliyun_country') || 'cn'; + aliwareLocal = aliwareLocal.toLowerCase(); + aliwareLocalSite = aliwareLocalSite.toLowerCase(); + // 当前语言 + AliwareI18n.prototype.currentLocal = aliwareLocal; + // 当前地区 + AliwareI18n.prototype.currentSite = aliwareLocalSite; + // 当前语言-地区 + AliwareI18n.prototype.currentLanguageCode = + aliwareGetCookieByKeyName('docsite_language') || `${aliwareLocal}-${aliwareLocalSite}`; + /** + * 通过key获取对应国际化文案 + * @param {String} key 国际化key + */ + AliwareI18n.prototype.get = function(key) { + return this.nowData[key]; + }; + /** + * 修改国际化文案数据 + * @param {String} local 语言信息 + */ + AliwareI18n.prototype.changeLanguage = function(local) { + this.nowData = i18DocObj[local] || {}; + }; + /** + * 数字国际化 + * @param {Number} num 数字 + */ + AliwareI18n.prototype.intlNumberFormat = function(num) { + if (typeof Intl !== 'object' || typeof Intl.NumberFormat !== 'function') { + return num; } - let aliwareLocal = aliwareGetCookieByKeyName('aliyun_lang') || 'zh'; - let aliwareLocalSite = aliwareGetCookieByKeyName('aliyun_country') || 'cn'; - aliwareLocal = aliwareLocal.toLowerCase(); - aliwareLocalSite = aliwareLocalSite.toLowerCase(); - //当前语言 - aliwareI18n.prototype.currentLocal = aliwareLocal; - //当前地区 - aliwareI18n.prototype.currentSite = aliwareLocalSite; - //当前语言-地区 - aliwareI18n.prototype.currentLanguageCode = aliwareGetCookieByKeyName('docsite_language') || `${aliwareLocal}-${aliwareLocalSite}`; - /** - * 通过key获取对应国际化文案 - * @param {String} key 国际化key - */ - aliwareI18n.prototype.get = function (key) { - return this.nowData[key]; + try { + return new Intl.NumberFormat(this.currentLanguageCode).format(num || 0); + } catch (error) { + return num; } - /** - * 修改国际化文案数据 - * @param {String} local 语言信息 - */ - aliwareI18n.prototype.changeLanguage = function (local) { - this.nowData = i18DocObj[local] || {} + }; + /** + * 时间戳格式化 + * @param {Number} num 时间戳 + * @param {Object} initOption 配置信息 + */ + AliwareI18n.prototype.intlTimeFormat = function(num = Date.now(), initOption = {}) { + try { + const date = Object.prototype.toString.call(num) === '[object Date]' ? num : new Date(num); + const options = Object.assign( + {}, + { + // weekday: "short", + hour12: false, + year: 'numeric', + month: 'short', + day: 'numeric', + hour: 'numeric', + minute: 'numeric', + second: 'numeric', + }, + initOption + ); + return date.toLocaleDateString(this.currentLanguageCode, options); + } catch (error) { + return typeof moment === 'function' ? moment(num).format() : '--'; } - /** - * 数字国际化 - * @param {Number} num 数字 - */ - aliwareI18n.prototype.intlNumberFormat = function (num) { - if (typeof Intl !== 'object' || typeof Intl.NumberFormat !== 'function') { - return num; - } - try { - return new Intl.NumberFormat(this.currentLanguageCode).format(num || 0); - } catch (error) { - return num; - } - } - /** - * 时间戳格式化 - * @param {Number} num 时间戳 - * @param {Object} initOption 配置信息 - */ - aliwareI18n.prototype.intlTimeFormat = function (num = Date.now(), initOption = {}) { - try { - let date = Object.prototype.toString.call(num) === '[object Date]' ? num : new Date(num); - let options = Object.assign({}, { - // weekday: "short", - hour12: false, - year: "numeric", - month: "short", - day: "numeric", - hour: "numeric", - minute: "numeric", - second: "numeric", - }, initOption); - return date.toLocaleDateString(this.currentLanguageCode, options); - } catch (error) { - return typeof moment === 'function' ? moment(num).format() : "--"; - } - } - /** - * 获取当前时间格式 - * @param {String} language 语言信息: zh/en - */ - aliwareI18n.prototype.getIntlTimeFormat = function (language) { - language = language ? language : aliwareLocal; - let langObj = { - zh: "YYYY年M月D日 HH:mm:ss", - en: "MMM D, YYYY, h:mm:ss A", - default: "YYYY-MM-DD HH:mm:ss" - } - return langObj[language] ? langObj[language] : langObj["default"]; - } - /** - * 设置moment的locale - * @param {String} languageCode 语言信息: zh-ch/en-us - */ - aliwareI18n.prototype.setMomentLocale = function (languageCode) { - if (Object.prototype.toString.call(moment) === "[object Function]") { - moment.locale(languageCode || this.currentLanguageCode); - return true; - } - return false; + }; + /** + * 获取当前时间格式 + * @param {String} language 语言信息: zh/en + */ + AliwareI18n.prototype.getIntlTimeFormat = function(_language) { + const language = _language || aliwareLocal; + const langObj = { + zh: 'YYYY年M月D日 HH:mm:ss', + en: 'MMM D, YYYY, h:mm:ss A', + default: 'YYYY-MM-DD HH:mm:ss', + }; + return langObj[language] ? langObj[language] : langObj.default; + }; + /** + * 设置moment的locale + * @param {String} languageCode 语言信息: zh-ch/en-us + */ + AliwareI18n.prototype.setMomentLocale = function(languageCode) { + if (Object.prototype.toString.call(moment) === '[object Function]') { + moment.locale(languageCode || this.currentLanguageCode); + return true; } + return false; + }; - return new aliwareI18n({ - currentLocal: `${aliwareLocal}`, - locals: i18DocObj[aliwareI18n.prototype.currentLanguageCode] || i18DocObj["en-us"] || i18DocObj["zh-cn"] || {} - }); + return new AliwareI18n({ + currentLocal: `${aliwareLocal}`, + locals: + i18DocObj[AliwareI18n.prototype.currentLanguageCode] || + i18DocObj['en-us'] || + i18DocObj['zh-cn'] || + {}, + }); })(global); /** * 获取url中的参数 */ -const getParams = (function (_global) { - return function (name) { - let reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i'); - let result = []; - if (_global.location.hash !== '') { - result = _global.location.hash.split('?'); //优先判别hash - } else { - result = _global.location.href.split('?'); - } - - if (result.length === 1) { - result = _global.parent.location.hash.split('?'); - } - - if (result.length > 1) { - let r = result[1].match(reg); - if (r != null) { - return decodeURIComponent(r[2]); - } - } - - return null; - }; -})(global); - -/** - * 设置参数 - */ -const setParams = (function (_global) { - const _originHref = _global.location.href.split("#")[0]; - return function (name, value) { - if (!name) { - return; - } - - let obj = {}; - if (typeof name === 'string') { - obj = { - [name]: value - } - } - - if (Object.prototype.toString.call(name) === '[object Object]') { - obj = name; - } - - let hashArr = []; - if (_global.location.hash) { - hashArr = _global.location.hash.split('?'); - } - - let paramArr = hashArr[1] && hashArr[1].split('&') || []; - - let paramObj = {}; - paramArr.forEach((val) => { - let tmpArr = val.split('='); - paramObj[tmpArr[0]] = decodeURIComponent(tmpArr[1] || ""); - }); - paramObj = Object.assign({}, paramObj, obj); - - let resArr = Object.keys(paramObj).map(function (key) { - return `${key}=${encodeURIComponent(paramObj[key] || "")}`; - }) || []; - - hashArr[1] = resArr.join('&'); - let hashStr = hashArr.join('?'); - if (_global.history.replaceState) { - let url = _originHref + hashStr; - _global.history.replaceState(null, '', url); - } else { - _global.location.hash = hashStr; - } +const getParams = (function(_global) { + return function(name) { + const reg = new RegExp(`(^|&)${name}=([^&]*)(&|$)`, 'i'); + let result = []; + if (_global.location.hash !== '') { + result = _global.location.hash.split('?'); // 优先判别hash + } else { + result = _global.location.href.split('?'); } -})(global); + if (result.length === 1) { + result = _global.parent.location.hash.split('?'); + } + + if (result.length > 1) { + const r = result[1].match(reg); + if (r != null) { + return decodeURIComponent(r[2]); + } + } + + return null; + }; +})(global); /** * 设置参数 */ -const setParam = function (name, value) { - return setParams.apply(this, arguments); -}; +const setParams = (function(global) { + let _global = global; + const _originHref = _global.location.href.split('#')[0]; + return function(name, value) { + if (!name) { + return; + } + let obj = {}; + if (typeof name === 'string') { + obj = { + [name]: value, + }; + } + + if (Object.prototype.toString.call(name) === '[object Object]') { + obj = name; + } + + let hashArr = []; + if (_global.location.hash) { + hashArr = _global.location.hash.split('?'); + } + + const paramArr = (hashArr[1] && hashArr[1].split('&')) || []; + + let paramObj = {}; + paramArr.forEach(val => { + const tmpArr = val.split('='); + paramObj[tmpArr[0]] = decodeURIComponent(tmpArr[1] || ''); + }); + paramObj = Object.assign({}, paramObj, obj); + + const resArr = + Object.keys(paramObj).map(key => `${key}=${encodeURIComponent(paramObj[key] || '')}`) || []; + + hashArr[1] = resArr.join('&'); + const hashStr = hashArr.join('?'); + if (_global.history.replaceState) { + const url = _originHref + hashStr; + _global.history.replaceState(null, '', url); + } else { + _global.location.hash = hashStr; + } + }; +})(global); + +/** + * 设置参数 + */ +const setParam = function(...args) { + return setParams.apply(this, args); +}; /** * 删除参数 */ -const removeParams = (function (_global) { - const _originHref = _global.location.href.split("#")[0]; - return function (name) { - let removeList = []; +const removeParams = (function(global) { + let _global = global; + const _originHref = _global.location.href.split('#')[0]; + return function(name) { + let removeList = []; - let nameType = Object.prototype.toString.call(name); - if (nameType === "[object String]") { - removeList.push(name); - } else if (nameType === "[object Array]") { - removeList = name; - } else if (nameType === "[object Object]") { - removeList = Object.keys(name); - } else { - return; - } - - let hashArr = []; - if (_global.location.hash) { - hashArr = _global.location.hash.split('?'); - } - - let paramArr = hashArr[1] && hashArr[1].split('&') || []; - - // let paramObj = {}; - paramArr = paramArr.filter((val) => { - let tmpArr = val.split('='); - return removeList.indexOf(tmpArr[0]) === -1; - }); - - hashArr[1] = paramArr.join('&'); - let hashStr = hashArr.join('?'); - if (_global.history.replaceState) { - let url = _originHref + hashStr; - _global.history.replaceState(null, '', url); - } else { - _global.location.hash = hashStr; - } + const nameType = Object.prototype.toString.call(name); + if (nameType === '[object String]') { + removeList.push(name); + } else if (nameType === '[object Array]') { + removeList = name; + } else if (nameType === '[object Object]') { + removeList = Object.keys(name); + } else { + return; } + + let hashArr = []; + if (_global.location.hash) { + hashArr = _global.location.hash.split('?'); + } + + let paramArr = (hashArr[1] && hashArr[1].split('&')) || []; + + // let paramObj = {}; + paramArr = paramArr.filter(val => { + const tmpArr = val.split('='); + return removeList.indexOf(tmpArr[0]) === -1; + }); + + hashArr[1] = paramArr.join('&'); + const hashStr = hashArr.join('?'); + if (_global.history.replaceState) { + const url = _originHref + hashStr; + _global.history.replaceState(null, '', url); + } else { + _global.location.hash = hashStr; + } + }; })(global); /** * 封装的ajax请求 */ -const request = (function (_global) { - let middlewareList = []; - let middlewareBackList = []; - let serviceMap = {}; - let serviceList = serviceConfig.serviceList || []; - let methodList = serviceConfig.method || []; - /** - * 获取真实url信息 - */ - let NacosRealUrlMapper = (function () { - serviceList.forEach(obj => { - serviceMap[obj.registerName] = obj; - }) - return function (registerName) { - let serviceObj = serviceMap[registerName]; - if (!serviceObj) { - return null; - } - //获取正确请求方式 - serviceObj.methodType = methodList[serviceObj.method]; - return serviceObj; - } - })() - /** - * 添加中间件函数 - * @param {*function} callback 回调函数 - */ - function middleWare(callback, isBack = true) { - if (isBack) { - middlewareBackList.push(callback); - } else { - middlewareList.push(callback); - } - return this; +const request = (function(_global) { + const middlewareList = []; + const middlewareBackList = []; + const serviceMap = {}; + const serviceList = serviceConfig.serviceList || []; + const methodList = serviceConfig.method || []; + /** + * 获取真实url信息 + */ + const NacosRealUrlMapper = (function() { + serviceList.forEach(obj => { + serviceMap[obj.registerName] = obj; + }); + return function(registerName) { + const serviceObj = serviceMap[registerName]; + if (!serviceObj) { + return null; + } + // 获取正确请求方式 + serviceObj.methodType = methodList[serviceObj.method]; + return serviceObj; + }; + })(); + /** + * 添加中间件函数 + * @param {*function} callback 回调函数 + */ + function middleWare(callback, isBack = true) { + if (isBack) { + middlewareBackList.push(callback); + } else { + middlewareList.push(callback); } - /** - * 处理中间件 - * @param {*Object} config ajax请求配置信息 - */ - function handleMiddleWare(config) { - //获取除config外传入的参数 - let args = [].slice.call(arguments, 1); - //最后一个参数为middlewareList - let middlewareList = args.pop() || []; - if (middlewareList && middlewareList.length > 0) { - config = middlewareList.reduce((config, callback) => { - if (typeof callback === 'function') { - return callback.apply(this, [config, ...args]) || config; - } - return config; - }, config) + return this; + } + /** + * 处理中间件 + * @param {*Object} config ajax请求配置信息 + */ + function handleMiddleWare(...allArgs) { + // 获取除config外传入的参数 + let [config, ...args] = allArgs; + // 最后一个参数为middlewareList + const middlewareList = args.pop() || []; + if (middlewareList && middlewareList.length > 0) { + config = middlewareList.reduce((config, callback) => { + if (typeof callback === 'function') { + return callback.apply(this, [config, ...args]) || config; } return config; + }, config); } - /** - * 处理自定义url - * @param {*Object} config ajax请求配置信息 - */ - function handleCustomService(config) { - //只处理com.alibaba.开头的url - if (config && config.url && config.url.indexOf('com.alibaba.') === 0) { - let registerName = config.url; - let serviceObj = NacosRealUrlMapper(registerName); - if (serviceObj && serviceObj.url && serviceObj.url.replace) { - //有mock数据 直接返回 生产环境失效 - if (projectConfig.is_preview && serviceObj.is_mock && config.success) { - let code = null; - try { - code = JSON.parse(serviceObj.defaults); - } catch (error) { - } - config.success(code); - return; - } - //替换url中的占位符 - config.url = serviceObj.url.replace(/{([^\}]+)}/g, function ($1, $2) { - return config.$data[$2]; - }) - try { - //添加静态参数 - if (serviceObj.is_param && typeof config.data === 'object') { - config.data = Object.assign({}, JSON.parse(serviceObj.params), config.data); - } - } catch (e) { - console.log(e) - } - //替换请求方式 - if (serviceObj.method && !config.type) { - config.type = serviceObj.methodType; - } - //将请求参数变为json格式 - if (serviceObj.isJsonData && typeof config.data === 'object') { - config.data = JSON.stringify(config.data) - config.processData = false; - config.dataType = 'json'; - config.contentType = 'application/json'; - } - try { - //设置临时代理 生产环境失效 - if (projectConfig.is_preview && serviceObj.is_proxy) { - let beforeSend = config.beforeSend; - config.beforeSend = function (xhr) { - serviceObj.cookie && xhr.setRequestHeader('tmpCookie', serviceObj.cookie); - serviceObj.header && xhr.setRequestHeader('tmpHeader', serviceObj.header); - serviceObj.proxy && xhr.setRequestHeader('tmpProxy', serviceObj.proxy) - beforeSend && beforeSend(xhr); - } - } - } catch (e) { - console.log(e) - } - //设置自动loading效果 - if (serviceObj.autoLoading) { - nacosUtils.openLoading(); - const prevComplete = config.complete; - config.complete = function () { - nacosUtils.closeLoading(); - typeof prevComplete === "function" && prevComplete.apply($, Array.prototype.slice.call(arguments)); - } - } - //serviceObj = null; - } + return config; + } + /** + * 处理自定义url + * @param {*Object} config ajax请求配置信息 + */ + function handleCustomService(...args) { + let [config] = args; + // 只处理com.alibaba.开头的url + if (config && config.url && config.url.indexOf('com.alibaba.') === 0) { + const registerName = config.url; + const serviceObj = NacosRealUrlMapper(registerName); + if (serviceObj && serviceObj.url && serviceObj.url.replace) { + // 有mock数据 直接返回 生产环境失效 + if (projectConfig.is_preview && serviceObj.is_mock && config.success) { + let code = null; + try { + code = JSON.parse(serviceObj.defaults); + } catch (error) {} + config.success(code); + return; } - return config; - } - - function Request(config) { - //除了config外的传参 - let args = [].slice.call(arguments, 1); - //处理前置中间件 - config = handleMiddleWare.apply(this, [config, ...args, middlewareList]); - //处理自定义url - config = handleCustomService.apply(this, [config, ...args]); - if (!config) - return; - //xsrf - if (config.type && config.type.toLowerCase() === 'post' && config.data && Object.prototype.toString.call(config.data) === '[object Object]' && !config.data.sec_token) { - let sec_token = aliwareGetCookieByKeyName('XSRF-TOKEN') - sec_token && (config.data.sec_token = sec_token); + // 替换url中的占位符 + config.url = serviceObj.url.replace(/{([^\}]+)}/g, ($1, $2) => config.$data[$2]); + try { + // 添加静态参数 + if (serviceObj.is_param && typeof config.data === 'object') { + config.data = Object.assign({}, JSON.parse(serviceObj.params), config.data); + } + } catch (e) {} + // 替换请求方式 + if (serviceObj.method && !config.type) { + config.type = serviceObj.methodType; } - - //处理后置中间件 - config = handleMiddleWare.apply(this, [config, ...args, middlewareBackList]); - - return $.ajax(Object.assign({}, config, { - type: config.type, - url: config.url, - data: config.data || '', - dataType: config.dataType || 'json', - beforeSend: function (xhr) { - config.beforeSend && config.beforeSend(xhr); - } - })) + // 将请求参数变为json格式 + if (serviceObj.isJsonData && typeof config.data === 'object') { + config.data = JSON.stringify(config.data); + config.processData = false; + config.dataType = 'json'; + config.contentType = 'application/json'; + } + try { + // 设置临时代理 生产环境失效 + if (projectConfig.is_preview && serviceObj.is_proxy) { + const { beforeSend } = config; + config.beforeSend = function(xhr) { + serviceObj.cookie && xhr.setRequestHeader('tmpCookie', serviceObj.cookie); + serviceObj.header && xhr.setRequestHeader('tmpHeader', serviceObj.header); + serviceObj.proxy && xhr.setRequestHeader('tmpProxy', serviceObj.proxy); + beforeSend && beforeSend(xhr); + }; + } + } catch (e) {} + // 设置自动loading效果 + if (serviceObj.autoLoading) { + nacosUtils.openLoading(); + const prevComplete = config.complete; + config.complete = function() { + nacosUtils.closeLoading(); + typeof prevComplete === 'function' && + prevComplete.apply($, Array.prototype.slice.call(args)); + }; + } + // serviceObj = null; + } } - //暴露方法 - Request.handleCustomService = handleCustomService; - Request.handleMiddleWare = handleMiddleWare; - Request.NacosRealUrlMapper = NacosRealUrlMapper; - Request.serviceList = serviceList; - Request.serviceMap = serviceMap; - Request.middleWare = middleWare; + return config; + } - return Request; + function Request(...allArgs) { + // 除了config外的传参 + let [config, ...args] = allArgs; + // 处理前置中间件 + config = handleMiddleWare.apply(this, [config, ...args, middlewareList]); + // 处理自定义url + config = handleCustomService.apply(this, [config, ...args]); + if (!config) return; + // xsrf + if ( + config.type && + config.type.toLowerCase() === 'post' && + config.data && + Object.prototype.toString.call(config.data) === '[object Object]' && + !config.data.sec_token + ) { + const sec_token = aliwareGetCookieByKeyName('XSRF-TOKEN'); + sec_token && (config.data.sec_token = sec_token); + } + + // 处理后置中间件 + config = handleMiddleWare.apply(this, [config, ...args, middlewareBackList]); + + return $.ajax( + Object.assign({}, config, { + type: config.type, + url: config.url, + data: config.data || '', + dataType: config.dataType || 'json', + beforeSend(xhr) { + config.beforeSend && config.beforeSend(xhr); + }, + }) + ); + } + // 暴露方法 + Request.handleCustomService = handleCustomService; + Request.handleMiddleWare = handleMiddleWare; + Request.NacosRealUrlMapper = NacosRealUrlMapper; + Request.serviceList = serviceList; + Request.serviceMap = serviceMap; + Request.middleWare = middleWare; + + return Request; })(global); export { - nacosEvent, - nacosUtils, - aliwareGetCookieByKeyName, - aliwareIntl, - getParams, - setParam, - setParams, - removeParams, - request -} \ No newline at end of file + nacosEvent, + nacosUtils, + aliwareGetCookieByKeyName, + aliwareIntl, + getParams, + setParam, + setParams, + removeParams, + request, +}; diff --git a/console/src/main/resources/static/src/i18ndoc.js b/console/src/main/resources/static/src/i18ndoc.js index 693598471..51f27c8a4 100644 --- a/console/src/main/resources/static/src/i18ndoc.js +++ b/console/src/main/resources/static/src/i18ndoc.js @@ -11,1042 +11,1042 @@ * limitations under the License. */ module.exports = { - "zh-cn": { - "com.alibaba.nacos.layout.noenv.nacosversion": "0.4.0", - "com.alibaba.nacos.page.configurationManagementVirtual": "配置管理", - "com.alibaba.nacos.page.serviceManagementVirtual": "服务管理", - "nacos.component.ExportDialog.tags2": "标签:", - "historyRollback": "历史版本", - "com.alibaba.nacos.component.MiddleWareEnv.Spas_dedicated": "Spas专用", - "com.alibaba.nacos.page.pushTrajectory.track": "条轨迹。", - "com.alibaba.nacos.component.NameSpaceList.Prompt": "提示", - "nacos.page.namespace.namespace_ID": "命名空间ID:", - "com.alibaba.nacos.page.historyrollback.query": "查询", - "com.alibaba.nacos.page.configdetail.configuration_details": "配置详情", - "com.alibaba.nacos.component.AddGroup.a_new_group": "新建Group", - "com.alibaba.nacos.component.DiffEditorDialog.contents": "内容比较", - "namespace": "命名空间", - "com.alibaba.nacos.page.historyRollback.queryresult": "查询结果:共查询到", - "com.alibaba.nacos.page.pushTrajectory.determine": "查询", - "com.alibaba.nacos.component.NameSpaceList.online_customer_support": "在线客服支持:", - "com.alibaba.nacos.page.historyRollback.dataid": "请输入Data ID", - "nacos.page.configurationManagement.Please_enter_tag": "请输入标签", - "nacos.page.namespace.namespace_number": "命名空间ID", - "nacos.component.NameSpaceList.Announcement_nodejs_version_is_developed,supports_a_custom_message": "公告:Node.js版上线。支持定制消息。", - "com.alibaba.nacos.page.configRollback.retracted": "收起", - "com.alibaba.nacos.component.NewDatePicker.to_cancel_the": "确定", - "com.alibaba.nacos.component.MiddleWareEnv.daily_units": "日常单元", - "nacos.page.configdetail.Open0": "开", - "com.alibaba.nacos.page.configeditor.vdchart": "请勿输入非法字符", - "com.alibaba.nacos.component.EditorNameSpace.prompt": "提示", - "com.alibaba.nacos.component.DiffEditorDialog.confirm_that_the": "确认发布", - "com.alibaba.nacos.component.NewDatePicker.": "最近", - "com.alibaba.nacos.pubshow": "子账号没有权限,请联系主账号负责人RAM上授权", - "com.alibaba.nacos.page.configeditor.Home_application:": "Group不能为空", - "nacos.page.configdetail.Tags": "标签:", - "com.alibaba.nacos.page.configurationManagement.configuration_management": "配置列表", - "nacos.page.configurationManagement.Tags": "标签:", - "com.alibaba.nacos.page.newconfig.new_listing": "新建配置", - "com.alibaba.nacos.page.configsync.target": "目标地域:", - "nacos.component.ExportDialog.configuration_number6": "配置数量:", - "nacos.component.validateDialog.title": "账号安全验证", - "nacos.page.configurationManagement.,_wherein": ",其中", - "com.alibaba.nacos.component.MiddleWareEnv.switch_environment": "切换环境", - "com.alibaba.nacos.page.configsync.return": "返回", - "newconfig": "新建配置", - "com.alibaba.nacos.page.configeditor.": "返回", - "com.alibaba.nacos.page.configsync.sync": "同步", - "com.alibaba.nacos.component.NewDatePicker.24_hours": "24小时", - "com.alibaba.nacos.page.listAllEnvironmental.environment_name": "环境名称", - "nacos.component.validateDialog.Click_to_get_verification_code": "点击获取验证码", - "com.alibaba.nacos.page.consistencyEfficacy.environment_marked": "环境标示", - "com.alibaba.nacos.component.NameSpaceList.Announcement_nodejs_version_is_developed,supports_a_custom_message": "公告:Node.js版上线,支持定制消息。", - "nacos.page.configurationManagement.process_is_successful,_the_cloned": "处理成功,克隆了", - "com.alibaba.nacos.page.configurationManagement.the_sample_code": "示例代码", - "nacos.component.CloneDialog.|_the_selected_entry4": "| 选中的条目", - "confirm": "确定", - "com.alibaba.nacos.page.configRollback.delete": "删除", - "com.alibaba.nacos.page.configsync.belongs_to_the_environment": "所属地域:", - "com.alibaba.nacos.component.ShowCodeing.loading": "加载中...", - "nacos.page.configurationManagement.import_failed": "导入失败", - "com.alibaba.nacos.page.configurationManagement.clickfordetail": "点击了解SDK详细示例", - "nacos.page.configurationManagement.configuration_management8": "配置管理", - "com.alibaba.nacos.page.consistencyEfficacy.operation": "操作", - "com.alibaba.nacos.page.environmentalManagement.view_environment_IP": "查看环境IP", - "com.alibaba.nacos.page.configeditor.configuration_formatpre": "默认不要勾选。", - "nacos.page.configurationManagement.Delete_failed": "删除失败", - "com.alibaba.nacos.page.environmentalManagement.environment_ip": "环境IP", - "com.alibaba.nacos.page.newconfig.Data_ID_length": "收起", - "nacos.page.configdetail.Data_encryption0": "数据加密", - "nacos.component.CloneDialog.get_the_namespace_failed": "获取命名空间失败", - "nacos.component.ImportDialog.Upload_File3": "上传文件", - "com.alibaba.nacos.page.configdetail.home": "归属应用:", - "com.alibaba.nacos.page.environmentalManagement.view": "查看", - "nacos.page.configurationManagement.configuration_item?": "条配置项?", - "com.alibaba.nacos.page.environmentalManagement.environment_name": "环境名称", - "nacos.page.namespace.AccessKey_recommended0": "AccessKey(推荐):", - "nacos.component.validateDialog.remark": "提示: 验证码会通过短信发送到您绑定的手机号。", - "com.alibaba.nacos.page.consistencyEfficacy.reset": "重置", - "com.alibaba.nacos.page.newconfig.group_placeholder": "请输入Group名称", - "com.alibaba.nacos.page.configdetail.belongs_to_the_environment": "地域:", - "com.alibaba.nacos.page.listeningToQuery.failure": "失败", - "hanxie.show": "测试", - "com.alibaba.nacos.page.newconfig.esc_exit": "发布", - "pubnodata": "没有数据", - "nacos.page.configurationManagement.ACM_dedicated_AccessKey_will_the_waste,_does_not_recommend_t": "ACM专用AccessKey(即将废弃,不建议使用):", - "com.alibaba.nacos.page.newconfig.configuration_format": "配置内容:", - "configurationManagement": "配置列表", - "nacos.component.ShowCodeing.,_6000);_System.out.println(content);_//_初始化的时候,给配置添加监听,配置变更会回调通知_C": "\", 6000);\t\t\tSystem.out.println(content);\t\t\t// 初始化的时候,给配置添加监听,配置变更会回调通知\t\t\tConfigService.addListener(\"", - "com.alibaba.nacos.component.NewDatePicker.custom": "时间范围不能超过45天", - "com.alibaba.nacos.page.historyDetail.recipient_from": "收起", - "com.alibaba.nacos.page.configdetail.recipient_from": "收起", - "nacos.component.validateDialog.Please_fill_out_the_verification_code": "输入验证码:", - "nacos.page.newconfig.Note_You_are_to_be_a_custom_packet_the_new_configuration,_make_sure_that_the_client_use_the_Pandora_version_higher_than_3._4._0,_otherwise_it_may_read_less_than_the_configuration.0": "注:您正在往一个自定义分组新增配置,请确保客户端使用的Pandora版本高于3.4.0,否则可能读取不到该配置。", - "com.alibaba.nacos.page.listeningToQuery.please_input_group": "请输入Group", - "com.alibaba.nacos.component.NewDatePicker.7_day": "7天", - "nacos.component.ShowCodeing.-Dproject.name=acmtest_-Dspas.identity=CUserswater.lyl.spas_keyacmt": "-Dproject.name=acmtest -Dspas.identity=C:Userswater.lyl.spas_keyacmtest\t\t\t * 在本地的acmtest文件中填写accessKey/secretKey,格式如下\t\t\t * accessKey=", - "nacos.component.DeleteDialog.deletetitle": "删除配置", - "com.alibaba.nacos.page.pushTrajectory.Push_the_trajectory": "推送轨迹", - "com.alibaba.nacos.page.configeditor.release": "发布Beta", - "com.alibaba.nacos.page.configeditor.Esc_exit": "按F1显示全屏", - "com.alibaba.nacos.page.configsync.home": "归属应用:", - "minute": "分钟", - "com.alibaba.nacos.layout.noenv.app_configuration_management_ACM": "NACOS", - "com.alibaba.nacos.page.configRollback.home": "归属应用:", - "nacos.page.configurationManagement.no_longer_display4": "不再显示:", - "nacos.page.configurationManagement.open_Bulletin_Board7": "打开公告栏", - "nacos.page.configurationManagement.SecretKey_recommended4": "SecretKey(推荐):", - "com.alibaba.nacos.page.pushTrajectory.configget": "配置推送 or 主动获取", - "com.alibaba.nacos.page.configRollback.action_type": "操作类型:", - "nacos.component.CloneDialog.target_space": "目标空间:", - "com.alibaba.nacos.component.DiffEditorDialog.original_value": "原始值", - "com.alibaba.nacos.page.configurationManagement.environment": "地域:", - "nacos.page.configdetail.Description": "描述:", - "com.alibaba.nacos.page.pushTrajectory.Data_Id_can_not_be_empty": "Data ID不能为空", - "com.alibaba.nacos.page.listAllEnvironmental.Into_the": "进入", - "com.alibaba.nacos.page.listeningToQuery._Push_state": "推送状态", - "nacos.component.CloneDialog.configuration_cloning(": "配置克隆(", - "com.alibaba.nacos.page.configurationManagement.new_listing": "新建配置", - "nacos.component.ExportDialog.source_space5": "源空间:", - "nacos.component.ShowCodeing.*///_ConfigService.init();_//_主动获取配置_String_content_=_ConfigService.getConfig(": "*///\t\t\tConfigService.init();\t\t\t\t\t\t// 主动获取配置\t\t\tString content = ConfigService.getConfig(\"", - "cancel": "取消", - "com.alibaba.nacos.component.MiddleWareEnv.online": "线上", - "com.alibaba.nacos.page.historyRollback.rollback": "回滚", - "com.alibaba.nacos.page.historyRollback.last_update_time": "最后更新时间", - "com.alibaba.nacos.page.pushTrajectory.please_enter": "请输入查询IP", - "com.alibaba.nacos.page.historyDetail.configure_content": "配置内容:", - "com.alibaba.nacos.page.consistencyEfficacy.environment_name": "环境名", - "nacos.component.ShowCodeing.-Dproject.name=acmtest_-Dspas.identity=CUserswater.lyl.spas_keyacmtest_*_在本地的acmtest文件中填写accessKey/secretKey,格式如下_*_accessKey=": "-Dproject.name=acmtest -Dspas.identity=C:Userswater.lyl.spas_keyacmtest\t\t\t * 在本地的acmtest文件中填写accessKey/secretKey,格式如下\t\t\t * accessKey=", - "nacos.page.configurationManagement.configuration_export9": "配置导出", - "nacos.page.namespace.note_ACM_is_dedicated_AK/SK_is_mainly_used_for_some_of_the_compatibility_scenario,_it_is_recommended_to_Unified_the_use_of_Ali_cloud_AK/SK.5": "注:ACM专用AK/SK主要用于一些兼容性场景。建议统一采用阿里云AK/SK。", - "com.alibaba.nacos.page.namespace.add": "新建命名空间", - "com.alibaba.nacos.page.configsync.sync_configuration_main": "同步配置", - "nacos.page.configeditor.Tags": "标签:", - "dateinfo1": "结束时间必须大于开始时间", - "com.alibaba.nacos.service.fill_the_code": "请填写验证码", - "nacos.page.newconfig.Description": "描述:", - "nacos.component.ImportDialog.target_space5": "目标空间:", - "configsync": "同步配置", - "nacos.component.CloneDialog.skip": "跳过", - "com.alibaba.nacos.page.configurationManagement.click_to_learn_Group": "点击了解Group", - "com.alibaba.nacos.page.newconfig.the_more_advanced": "Group不能为空", - "nacos.page.namespace.ACM_special_SecretKey_will_be_abandoned,_not_recommended_for_use4": "ACM专用SecretKey(即将废弃,不建议使用):", - "com.alibaba.nacos.page.namespace.public": "public(保留控件)", - "com.alibaba.nacos.page.configsync.error": "错误", - "nacos.page.namespace.AccessKey_recommended1": "AccessKey(开发环境推荐):", - "com.alibaba.nacos.page.pushTrajectory.configuration": "配置", - "com.alibaba.nacos.page.configeditor.toedit": "编辑配置", - "com.alibaba.nacos.component.NewDatePicker.12_hours": "12小时", - "com.alibaba.nacos.page.configsync.for_more_advanced_options": "更多高级选项", - "nacos.page.configurationManagement.AccessKey_recommended3": "AccessKey(开发环境推荐):", - "nacos.page.configurationManagement.note_ACM_is_dedicated_AK/SK_is_mainly_used_for_some_of_the_c": "注:ACM 专用AK/SK主要用于一些兼容性场景,推荐您统一采用阿里云AK/SK。", - "com.alibaba.nacos.page.newconfig.the_home_application": "目标地域:", - "com.alibaba.nacos.page.configeditor.official": "正式", - "nacos.component.validateDialog.phoneNumber": "手机号码:", - "nacos.page.namespace.SecretKey_recommended2": "SecretKey(推荐):", - "com.alibaba.nacos.page.namespace.delete": "删除", - "com.alibaba.nacos.component.NewDatePicker.60_-_": "60分钟", - "com.alibaba.nacos.page.configsync.retracted": "收起", - "nacos.page.configdetail.off1": "关", - "com.alibaba.nacos.page.historyDetail.delete": "删除", - "nacos.page.configurationManagement.items_for": "项为", - "nacos.component.CloneDialog.the_same_configuration": "相同配置:", - "com.alibaba.nacos.component.NewNameSpace.name": "命名空间名:", - "com.alibaba.nacos.component.MiddleWareEnv.line": "线上/", - "nacos.page.configurationManagement.batch_management": "批量管理", - "com.alibaba.nacos.page.configeditor.configure_contents_of": "配置格式:", - "com.alibaba.nacos.component.NewNameSpace.loading": "加载中...", - "com.alibaba.nacos.component.MiddleWareEnv.maletest": "阳中测试", - "nacos.page.configurationManagement.clone": "克隆", - "nacos.page.configurationManagement.a_ACM_front-end_monitoring_questionnaire,_the_time_limit_to_": "答 ACM 前端监控调查问卷,限时领取阿里云代金券\t 详情猛戳:", - "nacos.page.configurationManagement.HOME_Application": "归属应用:", - "com.alibaba.nacos.page.newconfig.publish_failed": "发布失败。请检查参数是否正确。", - "com.alibaba.nacos.page.historyDetail.belongs_to_the_environment": "所属地域:", - "com.alibaba.nacos.page.configRollback.configuration_rollback": "配置回滚", - "com.alibaba.nacos.page.configurationManagement.edit": "编辑", - "nacos.component.ImportDialog.skip1": "跳过", - "com.alibaba.nacos.page.pushTrajectory.Group_Id_cannot_be_empty": "Group不能为空", - "nacos.page.configurationManagement.successful_entry": "成功的条目:", - "com.alibaba.nacos.component.NewNameSpace.cancel": "取消", - "nacos.page.newconfig.Open0": "开", - "com.alibaba.nacos.page.configRollback.environment": "地域:", - "com.alibaba.nacos.page.pushTrajectory.The_new_configuration_value_persistent": "新配置值持久化", - "nacos.component.CloneDialog.tags": "标签:", - "com.alibaba.nacos.page.pushTrajectory.interval:": "时间区间:", - "nacos.component.DeleteDialog.determine": "确定", - "nacos.component.validateDialog.verification_code_error": "验证码错误", - "com.alibaba.nacos.page.configdetail.return": "返回", - "com.alibaba.nacos.page.listAllEnvironmental.operation": "操作", - "com.alibaba.nacos.page.newconfig.stop_fails": "停止Beta发布失败。", - "com.alibaba.nacos.component.EditorNameSpace.confirm_modify": "编辑命名空间", - "com.alibaba.nacos.component.EditorNameSpace.namespace": "命名空间不能为空", - "nacos.page.namespace.note_ACM_is_dedicated_AK/SK_is_mainly_used_for_some_of_the_compatibility_s": "注:ACM 专用AK/SK主要用于一些兼容性场景,推荐您统一采用阿里云AK/SK。", - "com.alibaba.nacos.component.MiddleWareEnv.daily_stable": "日常稳定", - "com.alibaba.nacos.page.pushTrajectory.used": "新配置生效", - "com.alibaba.nacos.page.configRollback.determine": "确定要", - "nacos.component.NameSpaceList.Quick_to_learn0": "学习路径", - "nacos.page.namespace.click_on_the_obtain_of1": "点击获取 》", - "com.alibaba.nacos.page.newconfig": "Data ID 不能为空", - "nacos.page.configurationManagement.export_check_failed": "导出检查失败", - "nacos.component.ImportDialog.file_upload_directly_after_importing_the_configuration,_please_be_sure_to_exercise_caution7": "文件上传后将直接导入配置,请务必谨慎操作", - "com.alibaba.nacos.page.namespace.prompt": "提示", - "nacos.page.namespace.sure_you_want_to_delete_the_following_namespaces?": "确定要删除以下命名空间吗?", - "nacos.component.validateDialog.confirm": "确定", - "nacos.page.configurationManagement.please_input_the_application_name": "请输入应用名", - "nacos.page.configurationManagement.please_select_the_required_delete_the_configuration_item": "请选择需要删除的配置项", - "com.alibaba.nacos.component.MiddleWareEnv.international": "国际化", - "com.alibaba.nacos.component.NewDatePicker.to": "查询范围:", - "com.alibaba.nacos.page.configeditor.recipient_from": "Data ID不能为空", - "nacos.page.configurationManagement.whether_to_delete_the_selected": "是否删除已选择的", - "com.alibaba.nacos.component.MiddleWareEnv.daily_environment_packet": "日常环境分组", - "com.alibaba.nacos.page.configeditor.toedittitle": "编辑配置", - "nacos.page.configeditor.Description": "描述:", - "day": "天", - "com.alibaba.nacos.page.listAllEnvironmental.view_environment_IP": "查看环境IP", - "com.alibaba.nacos.page.configurationManagement.delete": "删除", - "cspupcloud.page.historyRollback.Retained_for_30_days": "保留30天", - "com.alibaba.nacos.page.configeditor.beta_release:": "目标地域:", - "nacos.page.pushTrajectory.Please_enter_the_user_IP0": "请输入用户IP", - "com.alibaba.nacos.component.NewNameSpace.confirm": "确定", - "nacos.component.DeleteDialog.deleted_successfully_configured": "删除配置成功", - "nacos.component.ShowCodeing.,_new_PropertiesListener()_{_@Override_public_void_innerReceive(Pro": "\", new PropertiesListener() {\t\t\t\t\t\t\t\t@Override\t\t\t\tpublic void innerReceive(Properties properties) {\t\t\t\t\t// TODO Auto-generated method stub\t\t\t\t\tacmProperties = properties;\t\t\t\t\tSystem.out.println(properties);\t\t\t\t}\t\t\t});\t\t\t\t\t\t**/\t\t\t\t\t} catch (ConfigException e) {\t\t\te.printStackTrace();\t\t}\t\t// 测试让主线程不退出,因为订阅配置是守护线程,主线程退出守护线程就会退出。 正式代码中无需下面代码\t\twhile (true) {\t\t\ttry {\t\t\t\tThread.sleep(1000);\t\t\t} catch (InterruptedException e) {\t\t\t\te.printStackTrace();\t\t\t}\t\t}\t}\t // 通过get接口把配置值暴露出去使用 public static String getConfig() { return config; } \t// 通过get接口把配置值暴露出去使用\tpublic static Object getPorpertiesValue(String key) {\t\tif (acmProperties != null) {\t\t\treturn acmProperties.get(key);\t\t}\t\treturn null;\t}}", - "com.alibaba.nacos.page.namespace.operation": "操作", - "com.alibaba.nacos.page.configurationManagement.push_track": "推送轨迹", - "nacos.page.namespace.region_ID": "地域ID:", - "com.alibaba.nacos.component.NewNameSpace.norepeat": "命名空间名称不能重复", - "com.alibaba.nacos.page.configRollback.inserted": "插入", - "com.alibaba.nacos.page.configurationManagement.version": "历史版本", - "com.alibaba.nacos.page.configRollback.rollback": "回滚", - "nacos.page.namespace.delete_failed": "删除失败", - "com.alibaba.nacos.component.SuccessDialog.determine": "确定", - "nacos.page.configurationManagement.HOME_Application0": "归属应用:", - "to": "至", - "com.alibaba.nacos.page.environmentalManagement.operation": "操作", - "nacos.page.namespace.ACM_dedicated_AccessKey_will_the_waste,_does_not_recommend_the_use_of3": "ACM专用AccessKey(即将废弃,不建议使用):", - "com.alibaba.nacos.page.configurationManagement.configuration_query": "配置查询", - "nacos.component.validateDialog.fill_the_code": "请填写验证码", - "nacos.page.configurationManagement.Please_enter_the_name_of_the_app1": "请输入应用名", - "com.alibaba.nacos.page.newconfig.collapse": "更多高级选项", - "com.alibaba.nacos.page.namespace.edit": "编辑", - "nacos.page.namespace._Details_of6": "详情 》", - "com.alibaba.nacos.component.ShowCodeing.Sample_code": "示例代码", - "nacos.component.ImportDialog.Import_configuration4": "导入配置 ( ", - "nacos.page.configurationManagement.please_choose_the_required_export_configuration_items10": "请选择需要导出的配置项", - "com.alibaba.nacos.page.configdetail.beta_release": "Beta发布:", - "com.alibaba.nacos.page.configurationManagement.fuzzyd": "模糊查询请输入Data ID", - "com.alibaba.nacos.page.newconfig.group_is_not_empty": "Group ID长度不能超过127字符", - "com.alibaba.nacos.component.EditorNameSpace.private": "公共空间", - "com.alibaba.nacos.page.environmentalManagement.all_available_environment": "所有可用环境", - "dateinfo2": "时间范围不能超过45天", - "nacos.page.namespace.Namespace_details": "命名空间详情", - "nacos.component.ImportDialog.the_same_configuration6": "相同配置:", - "nacos.page.newconfig.Tags": "标签:", - "nacos.page.configurationManagement.Configuration_cloning0": "配置克隆", - "com.alibaba.nacos.component.NewDatePicker.4_hours": "4小时", - "com.alibaba.nacos.page.configeditor.group_is_not_empty": "更多高级选项", - "nacos.page.configurationManagement.SecretKey_recommended5": "SecretKey(开发环境推荐):", - "com.alibaba.nacos.page.configurationManagement.click_to_learn_DataId": "点击了解Data ID", - "nacos.page.configurationManagement.ACM_special_SecretKey_will_be_abandoned,_not_recommended_for": "ACM专用SecretKey(即将废弃,不建议使用):", - "com.alibaba.nacos.page.configsync.sync_configuration": "同步配置成功", - "com.alibaba.nacos.component.MiddleWareEnv.new_diamond": "新版Diamond", - "com.alibaba.nacos.page.newconfig.release": "返回", - "com.alibaba.nacos.page.configeditor.wrong": "错误", - "com.alibaba.nacos.page.pushTrajectory.user_IP": "用户IP", - "nacos.page.configeditor.Data_encryption0": "数据加密", - "com.alibaba.nacos.page.historyDetail.update": "更新", - "historyDetail": "历史详情", - "nacos.page.configurationManagement.select_need_to_clone_the_configuration_items1": "请选择需要克隆的配置项", - "nacos.page.configurationManagement._Details_of8": "详情 》", - "nacos.page.configurationManagement.Batch_processing0": "批量处理", - "com.alibaba.nacos.page.pushTrajectory.query_dimension": "查询维度:", - "nacos.component.NameSpaceList.Announcement_nodejs_version_is_developed,supports_a_custom_messag": "公告:Node.JS版上线。支持定制消息。", - "nacos.component.ShowCodeing.package_com.alibaba.middleware.acm;import_java.util.Properties;impo": "package com.alibaba.middleware.acm;import java.util.Properties;import com.alibaba.edas.acm.ConfigService;import com.alibaba.edas.acm.exception.ConfigException;import com.alibaba.edas.acm.listener.ConfigChangeListener;import com.alibaba.edas.acm.listener.PropertiesListener;// 示例代码,仅用于示例测试public class ACMTest { // 属性/开关 private static String config = \"DefaultValue\";\t private static Properties acmProperties = new Properties(); \tpublic static void main(String[] args) {\t\ttry {\t\t\t\t\t\t// 本地调试模式。本机测试无法连接ACM服务集群,因此设置debug模式(该模式下获取值为null,不会进入回调函数)。\t\t\t// ConfigService.setDebug(true);\t\t\t\t\t\t// 初始化配置服务,控制台通过示例代码自动获取下面参数\t\t\tConfigService.init(\"", - "com.alibaba.nacos.component.NewDatePicker.3_day": "3天", - "custom": "自定义", - "com.alibaba.nacos.component.MiddleWareEnv.daily_test_center": "日常测试中心", - "com.alibaba.nacos.page.configRollback.for_more_advanced": "更多高级选项", - "nacos.component.CloneDialog.Terminate_the_clone0": "终止克隆", - "com.alibaba.nacos.page.configurationManagement.operation": "操作", - "com.alibaba.nacos.layout.noenv.Click_to_learn_the_namespace": "点击了解命名空间", - "com.alibaba.nacos.page.configeditor.look": "查看推送轨迹", - "com.alibaba.nacos.component.NewNameSpace.newnamespce": "新建命名空间", - "com.alibaba.nacos.page.pushTrajectory.please_enter_a_query_Ip": "请输入查询IP", - "nacos.page.configurationManagement.export": "导出", - "com.alibaba.nacos.page.newconfig.new_listing_main": "新建配置", - "nacos.component.CloneDialog.select_namespace": "请选择命名空间", - "nacos.page.newconfig.Note_You_are_to_be_a_custom_packet_the_new_configuration,_make_sure_that_t": "注:您正在往一个自定义分组新增配置,请确保客户端使用的Pandora版本高于3.4.0,否则可能读取不到该配置。", - "com.alibaba.nacos.component.NameSpaceList.Announcement_nodejs_version_is_developed,supports_a_c": "公告:Node.js版上线。支持定制消息。", - "com.alibaba.nacos.page.configRollback.rollback_successful": "回滚成功", - "com.alibaba.nacos.page.pushTrajectory.getconifg": "配置推送 or 主动获取", - "com.alibaba.nacos.component.MiddleWareEnv.ungrouped": "未分组", - "nacos.page.configurationManagement.unprocessed_entry": "未处理的条目:", - "nacos.page.configurationManagement.ecs_ram_role": "自动下发 AccessKey 和 SecretKey (生产环境推荐):", - "com.alibaba.nacos.component.DiffEditorDialog.of_the_current_area": "当前值", - "com.alibaba.nacos.component.AddGroup.group_name": "Group名:", - "nacos.page.configurationManagement.Important_reminder0": "重要提醒", - "com.alibaba.nacos.page.pushTrajectory.the_query_results:_a_total_query_to": "查询结果:共查询到", - "configRollback": "配置回滚", - "com.alibaba.nacos.page.pushTrajectory.please_input_Group": "请输入Group", - "nacos.component.validateDialog.cancel": "取消", - "nacos.page.namespace.namespace_name": "命名空间名称:", - "com.alibaba.nacos.page.namespace.namespace_names": "命名空间名称", - "nacos.page.newconfig.off1": "关", - "com.alibaba.nacos.page.pushTrajectory.getconfig": "获取配置", - "nacos.page.namespace.SecretKey_recommended3": "SecretKey(开发环境推荐):", - "com.alibaba.nacos.page.pushTrajectory.configok": "新配置生效", - "nacos.component.ImportDialog.To_terminate_the_import0": "终止导入", - "nacos.page.configurationManagement.view_details1": "查看详情", - "com.alibaba.nacos.page.historyRollback.article_meet": "条满足要求的配置。", - "nacos.page.newconfig.data_encryption3": "数据加密:", - "com.alibaba.nacos.page.pushTrajectory.user_Ip": "用户IP:", - "com.alibaba.nacos.page.pushTrajectory.please_enter_the_dataID": "请输入Data ID", - "nacos.page.namespace.remove_the_namespace": "删除命名空间", - "com.alibaba.nacos.page.configurationManagement.listener_query": "监听查询", - "com.alibaba.nacos.page.consistencyEfficacy.edit": "编辑", - "com.alibaba.nacos.component.EditorNameSpace.load": "命名空间名:", - "com.alibaba.nacos.component.MiddleWareEnv.performance": "性能", - "nacos.page.namespace._Remove_the_namespace_success": "删除命名空间成功", - "nacos.page.configurationManagement.note_ACM_is_dedicated_AK/SK_is_mainly_used_for_some_of_the_compatibility_scenario,_it_is_recommended_to_Unified_the_use_of_Ali_cloud_AK/SK.7": "注:ACM 专用AK/SK主要用于一些兼容性场景,推荐您统一采用阿里云AK/SK。", - "com.alibaba.nacos.page.historyRollback.to_configure": "历史版本(保留30天)", - "com.alibaba.nacos.page.pushTrajectory.interval": "时间区间:", - "com.alibaba.nacos.page.consistencyEfficacy.details": "详情", - "com.alibaba.nacos.component.EditorNameSpace.edit_namespace": "加载中...", - "com.alibaba.nacos.page.newconfig.do_not_ente": "请勿输入非法字符", - "com.alibaba.nacos.component.MiddleWareEnv.from-test": "自测", - "nacos.page.configurationManagement.Please_enter_application_name1": "请输入应用名", - "nacos.component.ImportDialog.You_can_only_upload._zip_file_format0": "只能上传.zip格式的文件", - "com.alibaba.nacos.page.configeditor.stop_beta": "停止Beta", - "com.alibaba.nacos.component.SuccessDialog.failure": "失败", - "nacos.page.configurationManagement.bulk_delete": "批量删除", - "com.alibaba.nacos.page.historyRollback.details": "详情", - "com.alibaba.nacos.page.configeditor.more_advanced_options": "收起", - "com.alibaba.nacos.page.configdetail.configuration": "配置内容:", - "nacos.component.CloneDialog.configuration_number": "配置数量:", - "com.alibaba.nacos.component.EditorNameSpace.public_space": "确认修改", - "chaxunfanwei": "查询范围", - "com.alibaba.nacos.page.newconfig.full_screen": "按Esc退出全屏", - "com.alibaba.nacos.page.configeditor.the_target_environment:": "归属应用:", - "hour": "小时", - "com.alibaba.nacos.page.namespace.configuration": "配置数", - "nacos.page.configurationManagement.Cloning_check_fails": "克隆检查失败", - "com.alibaba.nacos.component.NewNameSpace.namespacenotnull": "命名空间不能为空", - "com.alibaba.nacos.page.configeditor.beta_release_notes(default_not_checked)": "Beta发布:", - "nacos.page.newconfig.to_the_authorization_of2": "去授权 》", - "com.alibaba.nacos.page.configeditor.return": "发布", - "com.alibaba.nacos.page.configurationManagement.more": "更多", - "com.alibaba.nacos.component.EnvConfigTopBar.context_switching": "环境切换", - "com.alibaba.nacos.component.SuccessDialog.Configuration_management": "配置管理", - "nacos.component.ImportDialog.cover2": "覆盖", - "com.alibaba.nacos.page.configurationManagement.last_modified_time": "最后修改时间", - "com.alibaba.nacos.page.newconfig.dataId_is_not_empty": "Data ID 长度不能超过255字符", - "com.alibaba.nacos.page.configeditor.configcontent": "配置内容", - "com.alibaba.nacos.component.NewNameSpace.input": "请勿输入非法字符", - "com.alibaba.nacos.page.configRollback.updated": "更新", - "com.alibaba.nacos.page.pushTrajectory.user_Ip:": "用户IP:", - "nacos.component.DeleteDialog.delete_the_configuration_failed": "删除配置失败", - "com.alibaba.nacos.component.SuccessDialog.success": "成功", - "nacos.page.configurationManagement._The_process_is_successful,_delete_the": "处理成功,删除了", - "com.alibaba.nacos.component.NewNameSpace.prompt": "提示", - "com.alibaba.nacos.page.configRollback.please_confirm_rollback": "回滚配置", - "com.alibaba.nacos.page.pushTrajectory.the_query_results": "查询结果:共查询到", - "com.alibaba.nacos.page.historyRollback.group": "请输入Group", - "nacos.component.ExportDialog.export_configuration4": "导出配置(", - "com.alibaba.nacos.page.consistencyEfficacy.configuration_consistency_check": "配置一致性校验", - "com.alibaba.nacos.page.newconfig.stop_beta": "停止Beta发布", - "com.alibaba.nacos.page.historyDetail.home": "归属应用:", - "nacos.component.ExportDialog.export3": "导出", - "com.alibaba.nacos.page.pushTrajectory.cluster_synchronization": "集群间同步通知", - "nacos.page.namespace.ecs_ram_role": "自动下发 AccessKey 和 SecretKey (生产环境推荐):", - "nacos.component.CloneDialog.HOME_Application": "归属应用:", - "nacos.page.namespace.Namespace": "命名空间", - "com.alibaba.nacos.component.EditorNameSpace.please_do": "请勿输入非法字符", - "com.alibaba.nacos.page.listeningToQuery.configuration": "配置", - "com.alibaba.nacos.component.MiddleWareEnv.cloud_unit": "云单元", - "nacos.page.configurationManagement.Clone_failed": "克隆失败", - "nacos.page.newconfig.The_opening_of_the_data_encryption-related_services0": "开通数据加密相关服务", - "com.alibaba.nacos.component.NewDatePicker.recently": "取消", - "com.alibaba.nacos.component.editorNameSpace": "私有空间", - "com.alibaba.nacos.page.configeditor.configuration_format:": "默认不要勾选。点击了解Beta发布详情。", - "pushTrajectory": "推送轨迹", - "com.alibaba.nacos.component.MiddleWareEnv.daily": "日常", - "nacos.component.ExportDialog.HOME_Application1": "归属应用:", - "nacos.page.newconfig._to_go_to_the_opening_of1": "\t 去开通 》", - "com.alibaba.nacos.component.NewDatePicker.determine": "至", - "nacos.page.configurationManagement.advanced_query9": "高级查询", - "nacos.page.configurationManagement.configuration": "项配置", - "nacos.page.configurationManagement.AccessKey_recommended2": "AccessKey(推荐):", - "configeditor": "配置编辑", - "com.alibaba.nacos.page.listAllEnvironmental.all_available_environment": "所有可用环境", - "com.alibaba.nacos.page.newconfig.configuration_contentmax": "配置内容最大长度不能超过10240字符", - "com.alibaba.nacos.page.configdetail.error": "错误", - "com.alibaba.nacos.component.NameSpaceList.immediate_use": "立即使用", - "com.alibaba.nacos.page.newconfig.Group_ID_cannot_be_longer": "归属应用:", - "listeningToQuery": "监听查询", - "Configdetail": "配置详情", - "com.alibaba.nacos.page.listAllEnvironmental.environment_marked": "环境标示", - "com.alibaba.nacos.page.configsync.configuration": "配置内容:", - "configdetail": "配置详情", - "com.alibaba.nacos.page.historyDetail.insert": "插入", - "com.alibaba.nacos.page.configdetail.official": "正式", - "nacos.page.configurationManagement.questionnaire2": "问卷调查", - "com.alibaba.nacos.component.AddGroup.prompt": "提示", - "com.alibaba.nacos.layout.noenv.app_configuration_management_acm": "NACOS", - "nacos.page.configurationManagement.process_is_successful,_import_the": "处理成功,导入了", - "nacos.component.DeleteDialog.Configuration_management": "配置管理", - "com.alibaba.nacos.page.consistencyEfficacy.configuration_content_md5": "配置内容MD5", - "com.alibaba.nacos.page.configRollback.return": "返回", - "com.alibaba.nacos.page.configurationManagement.details": "详情", - "nacos.page.namespace.details": "详情", - "com.alibaba.nacos.page.listeningToQuery.query_results:_query": "查询结果:共查询到", - "com.alibaba.nacos.page.form.Data_Id_can_not_be_empty": "Data ID不能为空", - "com.alibaba.nacos.page.listeningToQuery.group_can_not_be_empty": "Group不能为空", - "com.alibaba.nacos.page.configurationManagement.fuzzyg": "模糊查询请输入Group", - "nacos.component.NameSpaceList.Forum": "论坛", - "nacos.component.ShowCodeing.,_new_ConfigChangeListener()_{_public_void_receiveConfigInfo(String": "\", new ConfigChangeListener() {\t\t\t\tpublic void receiveConfigInfo(String configInfo) {\t\t\t\t\t// 当配置更新后,通过该回调函数将最新值吐给用户。\t\t\t\t\t// 注意回调函数中不要做阻塞操作,否则阻塞通知线程。\t\t\t\t\tconfig = configInfo;\t\t\t\t\tSystem.out.println(configInfo);\t\t\t\t}\t\t\t});\t\t\t\t\t\t/**\t\t\t * 如果配置值的內容为properties格式(key=value), 可使用下面监听器。以便一个配置管理多个配置项\t\t\t */\t\t\t\t\t\t/**\t\t\tConfigService.addListener(\"", - "com.alibaba.nacos.page.consistencyEfficacy.advanced_query": "高级查询", - "com.alibaba.nacos.page.listeningToQuery.please_enter_the_dataid": "请输入Data ID", - "nacos.component.ShowCodeing.,_6000);_System.out.println(content);_//_初始化的时候,给配置添加监听,配置变更会回调通知_ConfigService.addListener(": "\", 6000);\t\t\tSystem.out.println(content);\t\t\t// 初始化的时候,给配置添加监听,配置变更会回调通知\t\t\tConfigService.addListener(\"", - "nacos.component.CloneDialog.|_the_selected_entry": "| 选中的条目", - "nacos.page.newconfig.Data_encryption0": "数据加密", - "com.alibaba.nacos.page.environmentalManagement.environment_marked": "环境标示", - "com.alibaba.nacos.page.listeningToQuery.listener_query": "监听查询", - "nacos.component.ExportDialog.|_The_selected_entry0": "| 选中的条目", - "com.alibaba.nacos.page.consistencyEfficacy.query_results": "查询结果", - "nacos.page.namespace.deleted_successfully": "删除成功", - "nacos.component.CloneDialog.cover": "覆盖", - "com.alibaba.nacos.page.environmentalManagement.Into_the": "进入", - "com.alibaba.nacos.page.configdetail.more_advanced_options": "更多高级选项", - "com.alibaba.nacos.page.listeningToQuery.query_dimension": "查询维度:", - "com.alibaba.nacos.page.configRollback.configuration": "配置内容:", - "com.alibaba.nacos.page.historyDetail.more_advanced_options": "更多高级选项", - "com.alibaba.nacos.page.consistencyEfficacy.query": "查询", - "com.alibaba.nacos.page.listeningToQuery.please_input_ip": "请输入IP", - "com.alibaba.nacos.component.NewDatePicker.end_time_must_be_greater_than_the_start_time_of_the_t": "结束时间必须大于开始时间", - "com.alibaba.nacos.page.listAllEnvironmental.view": "查看", - "nacos.component.ShowCodeing.*///_ConfigService.init();_//_主动获取配置_String_content_=_ConfigService": "*///\t\t\tConfigService.init();\t\t\t\t\t\t// 主动获取配置\t\t\tString content = ConfigService.getConfig(\"", - "com.alibaba.nacos.page.newconfig.configure_contents_of": "按F1显示全屏", - "com.alibaba.nacos.page.listeningToQuery.success": "成功", - "com.alibaba.nacos.component.NewDatePicker.30_minutes": "30分钟", - "com.alibaba.nacos.page.historyDetail.history_details": "历史详情", - "com.alibaba.nacos.page.listeningToQuery.query": "查询", - "com.alibaba.nacos.page.newconfig.the_target_environment": "配置格式:", - "com.alibaba.nacos.layout.noenv.does_not_exist": "您访问的页面不存在", - "nacos.component.ImportDialog.file_upload_directly_after_importing_the_configuration,_please_be_": "文件上传后将直接导入配置,请务必谨慎操作", - "nacos.page.configurationManagement.ACM_dedicated_AccessKey_will_the_waste,_does_not_recommend_the_use_of5": "ACM专用AccessKey(即将废弃,不建议使用):", - "nacos.page.configurationManagement.import": "导入", - "com.alibaba.nacos.page.configurationManagement.suredelete": "确定要删除以下配置吗?", - "com.alibaba.nacos.page.configeditor.release_beta": "按Esc退出全屏", - "nacos.page.configurationManagement.no_announcement6": "暂无公告", - "com.alibaba.nacos.component.NewDatePicker.query_range:": "自定义", - "com.alibaba.nacos.page.configRollback.belongs_to": "所属地域:", - "com.alibaba.nacos.page.pushTrajectory.query_dimension:": "查询维度:", - "com.alibaba.nacos.component.MiddleWareEnv.payTM_daily": "payTM日常", - "nacos.page.configurationManagement.ACM_special_SecretKey_will_be_abandoned,_not_recommended_for_use6": "ACM专用SecretKey(即将废弃,不建议使用):", - "com.alibaba.nacos.page.configurationManagement.query": "查询", - "com.alibaba.nacos.component.MiddleWareEnv.offline": "线下", - "com.alibaba.nacos.page.listeningToQuery.article_meet_the_requirements_of_the_configuration.": "条满足要求的配置。", - "com.alibaba.nacos.page.configurationManagement.Remove_configuration": "删除配置", - "recent": "最近", - "com.alibaba.nacos.page.configeditor.F1/fn F1(MAC)full_screen": "配置内容", - "nacos.page.configurationManagement.off_the_Bulletin_Board5": "关闭公告栏", - "com.alibaba.nacos.page.historyDetail.action_type": "操作类型:", - "com.alibaba.nacos.page.listAllEnvironmental.environment_IP": "环境IP", - "nacos.component.CloneDialog.source_space": "源空间:", - "nacos.page.configurationManagement.click_on_the_obtain_of3": "点击获取 》", - "com.alibaba.nacos.page.configurationManagement.article_meet_the_requirements": "条满足要求的配置。", - "com.alibaba.nacos.page.historyRollback.operation": "操作", - "nacos.component.ShowCodeing.);_/**_*_生产环境通过jvm参数传参,以便使用多个环境,_-Dacm.endpoint=": "\");\t\t\t\t\t\t/**\t\t\t * 生产环境通过JVM参数传参,以便使用多个环境, -Dacm.endpoint=", - "com.alibaba.nacos.page.historyDetail.return": "返回", - "nacos.page.configurationManagement.failed_entry": "失败的条目:", - "nacos.component.CloneDialog.start_cloning": "开始克隆", - "com.alibaba.nacos.page.configRollback.the_following_configuration": "以下配置吗?", - "com.alibaba.nacos.page.configurationManagement.query_results": "查询结果:共查询到", - "nacos.page.configurationManagement.a_ACM_front-end_monitoring_questionnaire,_the_time_limit_to_receive_Ali_cloud_voucher_details_shoved_stamp_the3": "答 ACM 前端监控调查问卷,限时领取阿里云代金券\t 详情猛戳:", - "com.alibaba.nacos.component.MiddleWareEnv.online_center": "线上中心", - "com.alibaba.nacos.page.serviceManagement.service_list": "服务列表", - "com.alibaba.nacos.page.serviceManagement.service_name": "服务名称", - "com.alibaba.nacos.page.serviceManagement.please_enter_the_service_name": "请输入服务名称", - "com.alibaba.nacos.page.serviceManagement.table.column.service_name": "服务名", - "com.alibaba.nacos.page.serviceManagement.table.column.cluster_count": "集群数目", - "com.alibaba.nacos.page.serviceManagement.table.column.ip_count": "实例数", - "com.alibaba.nacos.page.serviceManagement.table.column.health_status": "健康实例数", - "com.alibaba.nacos.page.serviceManagement.table.column.operation": "操作", - "com.alibaba.nacos.page.serviceManagement.detail": "详情", - "com.alibaba.nacos.page.serviceManagement.delete": "删除", - "com.alibaba.nacos.page.serviceManagement.prompt": "提示", - "com.alibaba.nacos.page.serviceManagement.prompt_delete": "确定要删除当前服务吗?", - "com.alibaba.nacos.page.serviceManagement.create": "创建服务", - "com.alibaba.nacos.page.serviceManagement.query": "查询", - "serviceManagement": "服务列表", - "com.alibaba.nacos.page.serviceDetail.service_details": "服务详情", - "com.alibaba.nacos.page.serviceDetail.edit_service": "编辑服务", - "com.alibaba.nacos.page.serviceDetail.back": "返回", - "com.alibaba.nacos.page.serviceDetail.service_name": "服务名", - "com.alibaba.nacos.page.serviceDetail.protect_threshold": "保护阀值", - "com.alibaba.nacos.page.serviceDetail.health_check_pattern": "健康检查模式", - "com.alibaba.nacos.page.serviceDetail.health_check_pattern.service": "服务端", - "com.alibaba.nacos.page.serviceDetail.health_check_pattern.client": "客户端", - "com.alibaba.nacos.page.serviceDetail.health_check_pattern.none": "禁止", - "com.alibaba.nacos.page.serviceDetail.metadata": "元数据", - "com.alibaba.nacos.page.serviceDetail.create_service": "创建服务", - "com.alibaba.nacos.page.serviceDetail.update_service": "更新服务", - "com.alibaba.nacos.page.serviceDetail.cluster": "集群", - "com.alibaba.nacos.page.serviceDetail.edit_cluster": "集群配置", - "com.alibaba.nacos.page.serviceDetail.port": "端口", - "com.alibaba.nacos.page.serviceDetail.weight": "权重", - "com.alibaba.nacos.page.serviceDetail.healthy": "健康状态", - "com.alibaba.nacos.page.serviceDetail.operation": "操作", - "com.alibaba.nacos.page.serviceDetail.editor": "编辑", - "com.alibaba.nacos.page.serviceDetail.offline": "下线", - "com.alibaba.nacos.page.serviceDetail.online": "上线", - "com.alibaba.nacos.page.serviceDetail.check_type": "检查类型", - "com.alibaba.nacos.page.serviceDetail.check_port": "检查端口", - "com.alibaba.nacos.page.serviceDetail.use_ip_port_check": "使用IP端口检查", - "com.alibaba.nacos.page.serviceDetail.check_path": "检查路径", - "com.alibaba.nacos.page.serviceDetail.check_headers": "检查头", - "com.alibaba.nacos.page.serviceDetail.update_cluster": "更新集群", - "com.alibaba.nacos.page.serviceDetail.update_instance": "编辑实例", - "com.alibaba.nacos.page.serviceDetail.whether_online": "是否上线", - "serviceDetail": "服务详情", - "nacos.page.ConfigEditor.submit_failed": "不能为空, 提交失败", + 'zh-cn': { + 'com.alibaba.nacos.layout.noenv.nacosversion': '0.4.0', + 'com.alibaba.nacos.page.configurationManagementVirtual': '配置管理', + 'com.alibaba.nacos.page.serviceManagementVirtual': '服务管理', + 'nacos.component.ExportDialog.tags2': '标签:', + historyRollback: '历史版本', + 'com.alibaba.nacos.component.MiddleWareEnv.Spas_dedicated': 'Spas专用', + 'com.alibaba.nacos.page.pushTrajectory.track': '条轨迹。', + 'com.alibaba.nacos.component.NameSpaceList.Prompt': '提示', + 'nacos.page.namespace.namespace_ID': '命名空间ID:', + 'com.alibaba.nacos.page.historyrollback.query': '查询', + 'com.alibaba.nacos.page.configdetail.configuration_details': '配置详情', + 'com.alibaba.nacos.component.AddGroup.a_new_group': '新建Group', + 'com.alibaba.nacos.component.DiffEditorDialog.contents': '内容比较', + namespace: '命名空间', + 'com.alibaba.nacos.page.historyRollback.queryresult': '查询结果:共查询到', + 'com.alibaba.nacos.page.pushTrajectory.determine': '查询', + 'com.alibaba.nacos.component.NameSpaceList.online_customer_support': '在线客服支持:', + 'com.alibaba.nacos.page.historyRollback.dataid': '请输入Data ID', + 'nacos.page.configurationManagement.Please_enter_tag': '请输入标签', + 'nacos.page.namespace.namespace_number': '命名空间ID', + 'nacos.component.NameSpaceList.Announcement_nodejs_version_is_developed,supports_a_custom_message': '公告:Node.js版上线。支持定制消息。', + 'com.alibaba.nacos.page.configRollback.retracted': '收起', + 'com.alibaba.nacos.component.NewDatePicker.to_cancel_the': '确定', + 'com.alibaba.nacos.component.MiddleWareEnv.daily_units': '日常单元', + 'nacos.page.configdetail.Open0': '开', + 'com.alibaba.nacos.page.configeditor.vdchart': '请勿输入非法字符', + 'com.alibaba.nacos.component.EditorNameSpace.prompt': '提示', + 'com.alibaba.nacos.component.DiffEditorDialog.confirm_that_the': '确认发布', + 'com.alibaba.nacos.component.NewDatePicker.': '最近', + 'com.alibaba.nacos.pubshow': '子账号没有权限,请联系主账号负责人RAM上授权', + 'com.alibaba.nacos.page.configeditor.Home_application:': 'Group不能为空', + 'nacos.page.configdetail.Tags': '标签:', + 'com.alibaba.nacos.page.configurationManagement.configuration_management': '配置列表', + 'nacos.page.configurationManagement.Tags': '标签:', + 'com.alibaba.nacos.page.newconfig.new_listing': '新建配置', + 'com.alibaba.nacos.page.configsync.target': '目标地域:', + 'nacos.component.ExportDialog.configuration_number6': '配置数量:', + 'nacos.component.validateDialog.title': '账号安全验证', + 'nacos.page.configurationManagement.,_wherein': ',其中', + 'com.alibaba.nacos.component.MiddleWareEnv.switch_environment': '切换环境', + 'com.alibaba.nacos.page.configsync.return': '返回', + newconfig: '新建配置', + 'com.alibaba.nacos.page.configeditor.': '返回', + 'com.alibaba.nacos.page.configsync.sync': '同步', + 'com.alibaba.nacos.component.NewDatePicker.24_hours': '24小时', + 'com.alibaba.nacos.page.listAllEnvironmental.environment_name': '环境名称', + 'nacos.component.validateDialog.Click_to_get_verification_code': '点击获取验证码', + 'com.alibaba.nacos.page.consistencyEfficacy.environment_marked': '环境标示', + 'com.alibaba.nacos.component.NameSpaceList.Announcement_nodejs_version_is_developed,supports_a_custom_message': '公告:Node.js版上线,支持定制消息。', + 'nacos.page.configurationManagement.process_is_successful,_the_cloned': '处理成功,克隆了', + 'com.alibaba.nacos.page.configurationManagement.the_sample_code': '示例代码', + 'nacos.component.CloneDialog.|_the_selected_entry4': '| 选中的条目', + confirm: '确定', + 'com.alibaba.nacos.page.configRollback.delete': '删除', + 'com.alibaba.nacos.page.configsync.belongs_to_the_environment': '所属地域:', + 'com.alibaba.nacos.component.ShowCodeing.loading': '加载中...', + 'nacos.page.configurationManagement.import_failed': '导入失败', + 'com.alibaba.nacos.page.configurationManagement.clickfordetail': '点击了解SDK详细示例', + 'nacos.page.configurationManagement.configuration_management8': '配置管理', + 'com.alibaba.nacos.page.consistencyEfficacy.operation': '操作', + 'com.alibaba.nacos.page.environmentalManagement.view_environment_IP': '查看环境IP', + 'com.alibaba.nacos.page.configeditor.configuration_formatpre': '默认不要勾选。', + 'nacos.page.configurationManagement.Delete_failed': '删除失败', + 'com.alibaba.nacos.page.environmentalManagement.environment_ip': '环境IP', + 'com.alibaba.nacos.page.newconfig.Data_ID_length': '收起', + 'nacos.page.configdetail.Data_encryption0': '数据加密', + 'nacos.component.CloneDialog.get_the_namespace_failed': '获取命名空间失败', + 'nacos.component.ImportDialog.Upload_File3': '上传文件', + 'com.alibaba.nacos.page.configdetail.home': '归属应用:', + 'com.alibaba.nacos.page.environmentalManagement.view': '查看', + 'nacos.page.configurationManagement.configuration_item?': '条配置项?', + 'com.alibaba.nacos.page.environmentalManagement.environment_name': '环境名称', + 'nacos.page.namespace.AccessKey_recommended0': 'AccessKey(推荐):', + 'nacos.component.validateDialog.remark': '提示: 验证码会通过短信发送到您绑定的手机号。', + 'com.alibaba.nacos.page.consistencyEfficacy.reset': '重置', + 'com.alibaba.nacos.page.newconfig.group_placeholder': '请输入Group名称', + 'com.alibaba.nacos.page.configdetail.belongs_to_the_environment': '地域:', + 'com.alibaba.nacos.page.listeningToQuery.failure': '失败', + 'hanxie.show': '测试', + 'com.alibaba.nacos.page.newconfig.esc_exit': '发布', + pubnodata: '没有数据', + 'nacos.page.configurationManagement.ACM_dedicated_AccessKey_will_the_waste,_does_not_recommend_t': 'ACM专用AccessKey(即将废弃,不建议使用):', + 'com.alibaba.nacos.page.newconfig.configuration_format': '配置内容:', + configurationManagement: '配置列表', + 'nacos.component.ShowCodeing.,_6000);_System.out.println(content);_//_初始化的时候,给配置添加监听,配置变更会回调通知_C': '", 6000);\t\t\tSystem.out.println(content);\t\t\t// 初始化的时候,给配置添加监听,配置变更会回调通知\t\t\tConfigService.addListener("', + 'com.alibaba.nacos.component.NewDatePicker.custom': '时间范围不能超过45天', + 'com.alibaba.nacos.page.historyDetail.recipient_from': '收起', + 'com.alibaba.nacos.page.configdetail.recipient_from': '收起', + 'nacos.component.validateDialog.Please_fill_out_the_verification_code': '输入验证码:', + 'nacos.page.newconfig.Note_You_are_to_be_a_custom_packet_the_new_configuration,_make_sure_that_the_client_use_the_Pandora_version_higher_than_3._4._0,_otherwise_it_may_read_less_than_the_configuration.0': '注:您正在往一个自定义分组新增配置,请确保客户端使用的Pandora版本高于3.4.0,否则可能读取不到该配置。', + 'com.alibaba.nacos.page.listeningToQuery.please_input_group': '请输入Group', + 'com.alibaba.nacos.component.NewDatePicker.7_day': '7天', + 'nacos.component.ShowCodeing.-Dproject.name=acmtest_-Dspas.identity=CUserswater.lyl.spas_keyacmt': '-Dproject.name=acmtest -Dspas.identity=C:Userswater.lyl.spas_keyacmtest\t\t\t * 在本地的acmtest文件中填写accessKey/secretKey,格式如下\t\t\t * accessKey=', + 'nacos.component.DeleteDialog.deletetitle': '删除配置', + 'com.alibaba.nacos.page.pushTrajectory.Push_the_trajectory': '推送轨迹', + 'com.alibaba.nacos.page.configeditor.release': '发布Beta', + 'com.alibaba.nacos.page.configeditor.Esc_exit': '按F1显示全屏', + 'com.alibaba.nacos.page.configsync.home': '归属应用:', + minute: '分钟', + 'com.alibaba.nacos.layout.noenv.app_configuration_management_ACM': 'NACOS', + 'com.alibaba.nacos.page.configRollback.home': '归属应用:', + 'nacos.page.configurationManagement.no_longer_display4': '不再显示:', + 'nacos.page.configurationManagement.open_Bulletin_Board7': '打开公告栏', + 'nacos.page.configurationManagement.SecretKey_recommended4': 'SecretKey(推荐):', + 'com.alibaba.nacos.page.pushTrajectory.configget': '配置推送 or 主动获取', + 'com.alibaba.nacos.page.configRollback.action_type': '操作类型:', + 'nacos.component.CloneDialog.target_space': '目标空间:', + 'com.alibaba.nacos.component.DiffEditorDialog.original_value': '原始值', + 'com.alibaba.nacos.page.configurationManagement.environment': '地域:', + 'nacos.page.configdetail.Description': '描述:', + 'com.alibaba.nacos.page.pushTrajectory.Data_Id_can_not_be_empty': 'Data ID不能为空', + 'com.alibaba.nacos.page.listAllEnvironmental.Into_the': '进入', + 'com.alibaba.nacos.page.listeningToQuery._Push_state': '推送状态', + 'nacos.component.CloneDialog.configuration_cloning(': '配置克隆(', + 'com.alibaba.nacos.page.configurationManagement.new_listing': '新建配置', + 'nacos.component.ExportDialog.source_space5': '源空间:', + 'nacos.component.ShowCodeing.*///_ConfigService.init();_//_主动获取配置_String_content_=_ConfigService.getConfig(': '*///\t\t\tConfigService.init();\t\t\t\t\t\t// 主动获取配置\t\t\tString content = ConfigService.getConfig("', + cancel: '取消', + 'com.alibaba.nacos.component.MiddleWareEnv.online': '线上', + 'com.alibaba.nacos.page.historyRollback.rollback': '回滚', + 'com.alibaba.nacos.page.historyRollback.last_update_time': '最后更新时间', + 'com.alibaba.nacos.page.pushTrajectory.please_enter': '请输入查询IP', + 'com.alibaba.nacos.page.historyDetail.configure_content': '配置内容:', + 'com.alibaba.nacos.page.consistencyEfficacy.environment_name': '环境名', + 'nacos.component.ShowCodeing.-Dproject.name=acmtest_-Dspas.identity=CUserswater.lyl.spas_keyacmtest_*_在本地的acmtest文件中填写accessKey/secretKey,格式如下_*_accessKey=': '-Dproject.name=acmtest -Dspas.identity=C:Userswater.lyl.spas_keyacmtest\t\t\t * 在本地的acmtest文件中填写accessKey/secretKey,格式如下\t\t\t * accessKey=', + 'nacos.page.configurationManagement.configuration_export9': '配置导出', + 'nacos.page.namespace.note_ACM_is_dedicated_AK/SK_is_mainly_used_for_some_of_the_compatibility_scenario,_it_is_recommended_to_Unified_the_use_of_Ali_cloud_AK/SK.5': '注:ACM专用AK/SK主要用于一些兼容性场景。建议统一采用阿里云AK/SK。', + 'com.alibaba.nacos.page.namespace.add': '新建命名空间', + 'com.alibaba.nacos.page.configsync.sync_configuration_main': '同步配置', + 'nacos.page.configeditor.Tags': '标签:', + dateinfo1: '结束时间必须大于开始时间', + 'com.alibaba.nacos.service.fill_the_code': '请填写验证码', + 'nacos.page.newconfig.Description': '描述:', + 'nacos.component.ImportDialog.target_space5': '目标空间:', + configsync: '同步配置', + 'nacos.component.CloneDialog.skip': '跳过', + 'com.alibaba.nacos.page.configurationManagement.click_to_learn_Group': '点击了解Group', + 'com.alibaba.nacos.page.newconfig.the_more_advanced': 'Group不能为空', + 'nacos.page.namespace.ACM_special_SecretKey_will_be_abandoned,_not_recommended_for_use4': 'ACM专用SecretKey(即将废弃,不建议使用):', + 'com.alibaba.nacos.page.namespace.public': 'public(保留控件)', + 'com.alibaba.nacos.page.configsync.error': '错误', + 'nacos.page.namespace.AccessKey_recommended1': 'AccessKey(开发环境推荐):', + 'com.alibaba.nacos.page.pushTrajectory.configuration': '配置', + 'com.alibaba.nacos.page.configeditor.toedit': '编辑配置', + 'com.alibaba.nacos.component.NewDatePicker.12_hours': '12小时', + 'com.alibaba.nacos.page.configsync.for_more_advanced_options': '更多高级选项', + 'nacos.page.configurationManagement.AccessKey_recommended3': 'AccessKey(开发环境推荐):', + 'nacos.page.configurationManagement.note_ACM_is_dedicated_AK/SK_is_mainly_used_for_some_of_the_c': '注:ACM 专用AK/SK主要用于一些兼容性场景,推荐您统一采用阿里云AK/SK。', + 'com.alibaba.nacos.page.newconfig.the_home_application': '目标地域:', + 'com.alibaba.nacos.page.configeditor.official': '正式', + 'nacos.component.validateDialog.phoneNumber': '手机号码:', + 'nacos.page.namespace.SecretKey_recommended2': 'SecretKey(推荐):', + 'com.alibaba.nacos.page.namespace.delete': '删除', + 'com.alibaba.nacos.component.NewDatePicker.60_-_': '60分钟', + 'com.alibaba.nacos.page.configsync.retracted': '收起', + 'nacos.page.configdetail.off1': '关', + 'com.alibaba.nacos.page.historyDetail.delete': '删除', + 'nacos.page.configurationManagement.items_for': '项为', + 'nacos.component.CloneDialog.the_same_configuration': '相同配置:', + 'com.alibaba.nacos.component.NewNameSpace.name': '命名空间名:', + 'com.alibaba.nacos.component.MiddleWareEnv.line': '线上/', + 'nacos.page.configurationManagement.batch_management': '批量管理', + 'com.alibaba.nacos.page.configeditor.configure_contents_of': '配置格式:', + 'com.alibaba.nacos.component.NewNameSpace.loading': '加载中...', + 'com.alibaba.nacos.component.MiddleWareEnv.maletest': '阳中测试', + 'nacos.page.configurationManagement.clone': '克隆', + 'nacos.page.configurationManagement.a_ACM_front-end_monitoring_questionnaire,_the_time_limit_to_': '答 ACM 前端监控调查问卷,限时领取阿里云代金券\t 详情猛戳:', + 'nacos.page.configurationManagement.HOME_Application': '归属应用:', + 'com.alibaba.nacos.page.newconfig.publish_failed': '发布失败。请检查参数是否正确。', + 'com.alibaba.nacos.page.historyDetail.belongs_to_the_environment': '所属地域:', + 'com.alibaba.nacos.page.configRollback.configuration_rollback': '配置回滚', + 'com.alibaba.nacos.page.configurationManagement.edit': '编辑', + 'nacos.component.ImportDialog.skip1': '跳过', + 'com.alibaba.nacos.page.pushTrajectory.Group_Id_cannot_be_empty': 'Group不能为空', + 'nacos.page.configurationManagement.successful_entry': '成功的条目:', + 'com.alibaba.nacos.component.NewNameSpace.cancel': '取消', + 'nacos.page.newconfig.Open0': '开', + 'com.alibaba.nacos.page.configRollback.environment': '地域:', + 'com.alibaba.nacos.page.pushTrajectory.The_new_configuration_value_persistent': '新配置值持久化', + 'nacos.component.CloneDialog.tags': '标签:', + 'com.alibaba.nacos.page.pushTrajectory.interval:': '时间区间:', + 'nacos.component.DeleteDialog.determine': '确定', + 'nacos.component.validateDialog.verification_code_error': '验证码错误', + 'com.alibaba.nacos.page.configdetail.return': '返回', + 'com.alibaba.nacos.page.listAllEnvironmental.operation': '操作', + 'com.alibaba.nacos.page.newconfig.stop_fails': '停止Beta发布失败。', + 'com.alibaba.nacos.component.EditorNameSpace.confirm_modify': '编辑命名空间', + 'com.alibaba.nacos.component.EditorNameSpace.namespace': '命名空间不能为空', + 'nacos.page.namespace.note_ACM_is_dedicated_AK/SK_is_mainly_used_for_some_of_the_compatibility_s': '注:ACM 专用AK/SK主要用于一些兼容性场景,推荐您统一采用阿里云AK/SK。', + 'com.alibaba.nacos.component.MiddleWareEnv.daily_stable': '日常稳定', + 'com.alibaba.nacos.page.pushTrajectory.used': '新配置生效', + 'com.alibaba.nacos.page.configRollback.determine': '确定要', + 'nacos.component.NameSpaceList.Quick_to_learn0': '学习路径', + 'nacos.page.namespace.click_on_the_obtain_of1': '点击获取 》', + 'com.alibaba.nacos.page.newconfig': 'Data ID 不能为空', + 'nacos.page.configurationManagement.export_check_failed': '导出检查失败', + 'nacos.component.ImportDialog.file_upload_directly_after_importing_the_configuration,_please_be_sure_to_exercise_caution7': '文件上传后将直接导入配置,请务必谨慎操作', + 'com.alibaba.nacos.page.namespace.prompt': '提示', + 'nacos.page.namespace.sure_you_want_to_delete_the_following_namespaces?': '确定要删除以下命名空间吗?', + 'nacos.component.validateDialog.confirm': '确定', + 'nacos.page.configurationManagement.please_input_the_application_name': '请输入应用名', + 'nacos.page.configurationManagement.please_select_the_required_delete_the_configuration_item': '请选择需要删除的配置项', + 'com.alibaba.nacos.component.MiddleWareEnv.international': '国际化', + 'com.alibaba.nacos.component.NewDatePicker.to': '查询范围:', + 'com.alibaba.nacos.page.configeditor.recipient_from': 'Data ID不能为空', + 'nacos.page.configurationManagement.whether_to_delete_the_selected': '是否删除已选择的', + 'com.alibaba.nacos.component.MiddleWareEnv.daily_environment_packet': '日常环境分组', + 'com.alibaba.nacos.page.configeditor.toedittitle': '编辑配置', + 'nacos.page.configeditor.Description': '描述:', + day: '天', + 'com.alibaba.nacos.page.listAllEnvironmental.view_environment_IP': '查看环境IP', + 'com.alibaba.nacos.page.configurationManagement.delete': '删除', + 'cspupcloud.page.historyRollback.Retained_for_30_days': '保留30天', + 'com.alibaba.nacos.page.configeditor.beta_release:': '目标地域:', + 'nacos.page.pushTrajectory.Please_enter_the_user_IP0': '请输入用户IP', + 'com.alibaba.nacos.component.NewNameSpace.confirm': '确定', + 'nacos.component.DeleteDialog.deleted_successfully_configured': '删除配置成功', + 'nacos.component.ShowCodeing.,_new_PropertiesListener()_{_@Override_public_void_innerReceive(Pro': '", new PropertiesListener() {\t\t\t\t\t\t\t\t@Override\t\t\t\tpublic void innerReceive(Properties properties) {\t\t\t\t\t// TODO Auto-generated method stub\t\t\t\t\tacmProperties = properties;\t\t\t\t\tSystem.out.println(properties);\t\t\t\t}\t\t\t});\t\t\t\t\t\t**/\t\t\t\t\t} catch (ConfigException e) {\t\t\te.printStackTrace();\t\t}\t\t// 测试让主线程不退出,因为订阅配置是守护线程,主线程退出守护线程就会退出。 正式代码中无需下面代码\t\twhile (true) {\t\t\ttry {\t\t\t\tThread.sleep(1000);\t\t\t} catch (InterruptedException e) {\t\t\t\te.printStackTrace();\t\t\t}\t\t}\t}\t // 通过get接口把配置值暴露出去使用 public static String getConfig() { return config; } \t// 通过get接口把配置值暴露出去使用\tpublic static Object getPorpertiesValue(String key) {\t\tif (acmProperties != null) {\t\t\treturn acmProperties.get(key);\t\t}\t\treturn null;\t}}', + 'com.alibaba.nacos.page.namespace.operation': '操作', + 'com.alibaba.nacos.page.configurationManagement.push_track': '推送轨迹', + 'nacos.page.namespace.region_ID': '地域ID:', + 'com.alibaba.nacos.component.NewNameSpace.norepeat': '命名空间名称不能重复', + 'com.alibaba.nacos.page.configRollback.inserted': '插入', + 'com.alibaba.nacos.page.configurationManagement.version': '历史版本', + 'com.alibaba.nacos.page.configRollback.rollback': '回滚', + 'nacos.page.namespace.delete_failed': '删除失败', + 'com.alibaba.nacos.component.SuccessDialog.determine': '确定', + 'nacos.page.configurationManagement.HOME_Application0': '归属应用:', + to: '至', + 'com.alibaba.nacos.page.environmentalManagement.operation': '操作', + 'nacos.page.namespace.ACM_dedicated_AccessKey_will_the_waste,_does_not_recommend_the_use_of3': 'ACM专用AccessKey(即将废弃,不建议使用):', + 'com.alibaba.nacos.page.configurationManagement.configuration_query': '配置查询', + 'nacos.component.validateDialog.fill_the_code': '请填写验证码', + 'nacos.page.configurationManagement.Please_enter_the_name_of_the_app1': '请输入应用名', + 'com.alibaba.nacos.page.newconfig.collapse': '更多高级选项', + 'com.alibaba.nacos.page.namespace.edit': '编辑', + 'nacos.page.namespace._Details_of6': '详情 》', + 'com.alibaba.nacos.component.ShowCodeing.Sample_code': '示例代码', + 'nacos.component.ImportDialog.Import_configuration4': '导入配置 ( ', + 'nacos.page.configurationManagement.please_choose_the_required_export_configuration_items10': '请选择需要导出的配置项', + 'com.alibaba.nacos.page.configdetail.beta_release': 'Beta发布:', + 'com.alibaba.nacos.page.configurationManagement.fuzzyd': '模糊查询请输入Data ID', + 'com.alibaba.nacos.page.newconfig.group_is_not_empty': 'Group ID长度不能超过127字符', + 'com.alibaba.nacos.component.EditorNameSpace.private': '公共空间', + 'com.alibaba.nacos.page.environmentalManagement.all_available_environment': '所有可用环境', + dateinfo2: '时间范围不能超过45天', + 'nacos.page.namespace.Namespace_details': '命名空间详情', + 'nacos.component.ImportDialog.the_same_configuration6': '相同配置:', + 'nacos.page.newconfig.Tags': '标签:', + 'nacos.page.configurationManagement.Configuration_cloning0': '配置克隆', + 'com.alibaba.nacos.component.NewDatePicker.4_hours': '4小时', + 'com.alibaba.nacos.page.configeditor.group_is_not_empty': '更多高级选项', + 'nacos.page.configurationManagement.SecretKey_recommended5': 'SecretKey(开发环境推荐):', + 'com.alibaba.nacos.page.configurationManagement.click_to_learn_DataId': '点击了解Data ID', + 'nacos.page.configurationManagement.ACM_special_SecretKey_will_be_abandoned,_not_recommended_for': 'ACM专用SecretKey(即将废弃,不建议使用):', + 'com.alibaba.nacos.page.configsync.sync_configuration': '同步配置成功', + 'com.alibaba.nacos.component.MiddleWareEnv.new_diamond': '新版Diamond', + 'com.alibaba.nacos.page.newconfig.release': '返回', + 'com.alibaba.nacos.page.configeditor.wrong': '错误', + 'com.alibaba.nacos.page.pushTrajectory.user_IP': '用户IP', + 'nacos.page.configeditor.Data_encryption0': '数据加密', + 'com.alibaba.nacos.page.historyDetail.update': '更新', + historyDetail: '历史详情', + 'nacos.page.configurationManagement.select_need_to_clone_the_configuration_items1': '请选择需要克隆的配置项', + 'nacos.page.configurationManagement._Details_of8': '详情 》', + 'nacos.page.configurationManagement.Batch_processing0': '批量处理', + 'com.alibaba.nacos.page.pushTrajectory.query_dimension': '查询维度:', + 'nacos.component.NameSpaceList.Announcement_nodejs_version_is_developed,supports_a_custom_messag': '公告:Node.JS版上线。支持定制消息。', + 'nacos.component.ShowCodeing.package_com.alibaba.middleware.acm;import_java.util.Properties;impo': 'package com.alibaba.middleware.acm;import java.util.Properties;import com.alibaba.edas.acm.ConfigService;import com.alibaba.edas.acm.exception.ConfigException;import com.alibaba.edas.acm.listener.ConfigChangeListener;import com.alibaba.edas.acm.listener.PropertiesListener;// 示例代码,仅用于示例测试public class ACMTest { // 属性/开关 private static String config = "DefaultValue";\t private static Properties acmProperties = new Properties(); \tpublic static void main(String[] args) {\t\ttry {\t\t\t\t\t\t// 本地调试模式。本机测试无法连接ACM服务集群,因此设置debug模式(该模式下获取值为null,不会进入回调函数)。\t\t\t// ConfigService.setDebug(true);\t\t\t\t\t\t// 初始化配置服务,控制台通过示例代码自动获取下面参数\t\t\tConfigService.init("', + 'com.alibaba.nacos.component.NewDatePicker.3_day': '3天', + custom: '自定义', + 'com.alibaba.nacos.component.MiddleWareEnv.daily_test_center': '日常测试中心', + 'com.alibaba.nacos.page.configRollback.for_more_advanced': '更多高级选项', + 'nacos.component.CloneDialog.Terminate_the_clone0': '终止克隆', + 'com.alibaba.nacos.page.configurationManagement.operation': '操作', + 'com.alibaba.nacos.layout.noenv.Click_to_learn_the_namespace': '点击了解命名空间', + 'com.alibaba.nacos.page.configeditor.look': '查看推送轨迹', + 'com.alibaba.nacos.component.NewNameSpace.newnamespce': '新建命名空间', + 'com.alibaba.nacos.page.pushTrajectory.please_enter_a_query_Ip': '请输入查询IP', + 'nacos.page.configurationManagement.export': '导出', + 'com.alibaba.nacos.page.newconfig.new_listing_main': '新建配置', + 'nacos.component.CloneDialog.select_namespace': '请选择命名空间', + 'nacos.page.newconfig.Note_You_are_to_be_a_custom_packet_the_new_configuration,_make_sure_that_t': '注:您正在往一个自定义分组新增配置,请确保客户端使用的Pandora版本高于3.4.0,否则可能读取不到该配置。', + 'com.alibaba.nacos.component.NameSpaceList.Announcement_nodejs_version_is_developed,supports_a_c': '公告:Node.js版上线。支持定制消息。', + 'com.alibaba.nacos.page.configRollback.rollback_successful': '回滚成功', + 'com.alibaba.nacos.page.pushTrajectory.getconifg': '配置推送 or 主动获取', + 'com.alibaba.nacos.component.MiddleWareEnv.ungrouped': '未分组', + 'nacos.page.configurationManagement.unprocessed_entry': '未处理的条目:', + 'nacos.page.configurationManagement.ecs_ram_role': '自动下发 AccessKey 和 SecretKey (生产环境推荐):', + 'com.alibaba.nacos.component.DiffEditorDialog.of_the_current_area': '当前值', + 'com.alibaba.nacos.component.AddGroup.group_name': 'Group名:', + 'nacos.page.configurationManagement.Important_reminder0': '重要提醒', + 'com.alibaba.nacos.page.pushTrajectory.the_query_results:_a_total_query_to': '查询结果:共查询到', + configRollback: '配置回滚', + 'com.alibaba.nacos.page.pushTrajectory.please_input_Group': '请输入Group', + 'nacos.component.validateDialog.cancel': '取消', + 'nacos.page.namespace.namespace_name': '命名空间名称:', + 'com.alibaba.nacos.page.namespace.namespace_names': '命名空间名称', + 'nacos.page.newconfig.off1': '关', + 'com.alibaba.nacos.page.pushTrajectory.getconfig': '获取配置', + 'nacos.page.namespace.SecretKey_recommended3': 'SecretKey(开发环境推荐):', + 'com.alibaba.nacos.page.pushTrajectory.configok': '新配置生效', + 'nacos.component.ImportDialog.To_terminate_the_import0': '终止导入', + 'nacos.page.configurationManagement.view_details1': '查看详情', + 'com.alibaba.nacos.page.historyRollback.article_meet': '条满足要求的配置。', + 'nacos.page.newconfig.data_encryption3': '数据加密:', + 'com.alibaba.nacos.page.pushTrajectory.user_Ip': '用户IP:', + 'com.alibaba.nacos.page.pushTrajectory.please_enter_the_dataID': '请输入Data ID', + 'nacos.page.namespace.remove_the_namespace': '删除命名空间', + 'com.alibaba.nacos.page.configurationManagement.listener_query': '监听查询', + 'com.alibaba.nacos.page.consistencyEfficacy.edit': '编辑', + 'com.alibaba.nacos.component.EditorNameSpace.load': '命名空间名:', + 'com.alibaba.nacos.component.MiddleWareEnv.performance': '性能', + 'nacos.page.namespace._Remove_the_namespace_success': '删除命名空间成功', + 'nacos.page.configurationManagement.note_ACM_is_dedicated_AK/SK_is_mainly_used_for_some_of_the_compatibility_scenario,_it_is_recommended_to_Unified_the_use_of_Ali_cloud_AK/SK.7': '注:ACM 专用AK/SK主要用于一些兼容性场景,推荐您统一采用阿里云AK/SK。', + 'com.alibaba.nacos.page.historyRollback.to_configure': '历史版本(保留30天)', + 'com.alibaba.nacos.page.pushTrajectory.interval': '时间区间:', + 'com.alibaba.nacos.page.consistencyEfficacy.details': '详情', + 'com.alibaba.nacos.component.EditorNameSpace.edit_namespace': '加载中...', + 'com.alibaba.nacos.page.newconfig.do_not_ente': '请勿输入非法字符', + 'com.alibaba.nacos.component.MiddleWareEnv.from-test': '自测', + 'nacos.page.configurationManagement.Please_enter_application_name1': '请输入应用名', + 'nacos.component.ImportDialog.You_can_only_upload._zip_file_format0': '只能上传.zip格式的文件', + 'com.alibaba.nacos.page.configeditor.stop_beta': '停止Beta', + 'com.alibaba.nacos.component.SuccessDialog.failure': '失败', + 'nacos.page.configurationManagement.bulk_delete': '批量删除', + 'com.alibaba.nacos.page.historyRollback.details': '详情', + 'com.alibaba.nacos.page.configeditor.more_advanced_options': '收起', + 'com.alibaba.nacos.page.configdetail.configuration': '配置内容:', + 'nacos.component.CloneDialog.configuration_number': '配置数量:', + 'com.alibaba.nacos.component.EditorNameSpace.public_space': '确认修改', + chaxunfanwei: '查询范围', + 'com.alibaba.nacos.page.newconfig.full_screen': '按Esc退出全屏', + 'com.alibaba.nacos.page.configeditor.the_target_environment:': '归属应用:', + hour: '小时', + 'com.alibaba.nacos.page.namespace.configuration': '配置数', + 'nacos.page.configurationManagement.Cloning_check_fails': '克隆检查失败', + 'com.alibaba.nacos.component.NewNameSpace.namespacenotnull': '命名空间不能为空', + 'com.alibaba.nacos.page.configeditor.beta_release_notes(default_not_checked)': 'Beta发布:', + 'nacos.page.newconfig.to_the_authorization_of2': '去授权 》', + 'com.alibaba.nacos.page.configeditor.return': '发布', + 'com.alibaba.nacos.page.configurationManagement.more': '更多', + 'com.alibaba.nacos.component.EnvConfigTopBar.context_switching': '环境切换', + 'com.alibaba.nacos.component.SuccessDialog.Configuration_management': '配置管理', + 'nacos.component.ImportDialog.cover2': '覆盖', + 'com.alibaba.nacos.page.configurationManagement.last_modified_time': '最后修改时间', + 'com.alibaba.nacos.page.newconfig.dataId_is_not_empty': 'Data ID 长度不能超过255字符', + 'com.alibaba.nacos.page.configeditor.configcontent': '配置内容', + 'com.alibaba.nacos.component.NewNameSpace.input': '请勿输入非法字符', + 'com.alibaba.nacos.page.configRollback.updated': '更新', + 'com.alibaba.nacos.page.pushTrajectory.user_Ip:': '用户IP:', + 'nacos.component.DeleteDialog.delete_the_configuration_failed': '删除配置失败', + 'com.alibaba.nacos.component.SuccessDialog.success': '成功', + 'nacos.page.configurationManagement._The_process_is_successful,_delete_the': '处理成功,删除了', + 'com.alibaba.nacos.component.NewNameSpace.prompt': '提示', + 'com.alibaba.nacos.page.configRollback.please_confirm_rollback': '回滚配置', + 'com.alibaba.nacos.page.pushTrajectory.the_query_results': '查询结果:共查询到', + 'com.alibaba.nacos.page.historyRollback.group': '请输入Group', + 'nacos.component.ExportDialog.export_configuration4': '导出配置(', + 'com.alibaba.nacos.page.consistencyEfficacy.configuration_consistency_check': '配置一致性校验', + 'com.alibaba.nacos.page.newconfig.stop_beta': '停止Beta发布', + 'com.alibaba.nacos.page.historyDetail.home': '归属应用:', + 'nacos.component.ExportDialog.export3': '导出', + 'com.alibaba.nacos.page.pushTrajectory.cluster_synchronization': '集群间同步通知', + 'nacos.page.namespace.ecs_ram_role': '自动下发 AccessKey 和 SecretKey (生产环境推荐):', + 'nacos.component.CloneDialog.HOME_Application': '归属应用:', + 'nacos.page.namespace.Namespace': '命名空间', + 'com.alibaba.nacos.component.EditorNameSpace.please_do': '请勿输入非法字符', + 'com.alibaba.nacos.page.listeningToQuery.configuration': '配置', + 'com.alibaba.nacos.component.MiddleWareEnv.cloud_unit': '云单元', + 'nacos.page.configurationManagement.Clone_failed': '克隆失败', + 'nacos.page.newconfig.The_opening_of_the_data_encryption-related_services0': '开通数据加密相关服务', + 'com.alibaba.nacos.component.NewDatePicker.recently': '取消', + 'com.alibaba.nacos.component.editorNameSpace': '私有空间', + 'com.alibaba.nacos.page.configeditor.configuration_format:': '默认不要勾选。点击了解Beta发布详情。', + pushTrajectory: '推送轨迹', + 'com.alibaba.nacos.component.MiddleWareEnv.daily': '日常', + 'nacos.component.ExportDialog.HOME_Application1': '归属应用:', + 'nacos.page.newconfig._to_go_to_the_opening_of1': '\t 去开通 》', + 'com.alibaba.nacos.component.NewDatePicker.determine': '至', + 'nacos.page.configurationManagement.advanced_query9': '高级查询', + 'nacos.page.configurationManagement.configuration': '项配置', + 'nacos.page.configurationManagement.AccessKey_recommended2': 'AccessKey(推荐):', + configeditor: '配置编辑', + 'com.alibaba.nacos.page.listAllEnvironmental.all_available_environment': '所有可用环境', + 'com.alibaba.nacos.page.newconfig.configuration_contentmax': '配置内容最大长度不能超过10240字符', + 'com.alibaba.nacos.page.configdetail.error': '错误', + 'com.alibaba.nacos.component.NameSpaceList.immediate_use': '立即使用', + 'com.alibaba.nacos.page.newconfig.Group_ID_cannot_be_longer': '归属应用:', + listeningToQuery: '监听查询', + Configdetail: '配置详情', + 'com.alibaba.nacos.page.listAllEnvironmental.environment_marked': '环境标示', + 'com.alibaba.nacos.page.configsync.configuration': '配置内容:', + configdetail: '配置详情', + 'com.alibaba.nacos.page.historyDetail.insert': '插入', + 'com.alibaba.nacos.page.configdetail.official': '正式', + 'nacos.page.configurationManagement.questionnaire2': '问卷调查', + 'com.alibaba.nacos.component.AddGroup.prompt': '提示', + 'com.alibaba.nacos.layout.noenv.app_configuration_management_acm': 'NACOS', + 'nacos.page.configurationManagement.process_is_successful,_import_the': '处理成功,导入了', + 'nacos.component.DeleteDialog.Configuration_management': '配置管理', + 'com.alibaba.nacos.page.consistencyEfficacy.configuration_content_md5': '配置内容MD5', + 'com.alibaba.nacos.page.configRollback.return': '返回', + 'com.alibaba.nacos.page.configurationManagement.details': '详情', + 'nacos.page.namespace.details': '详情', + 'com.alibaba.nacos.page.listeningToQuery.query_results:_query': '查询结果:共查询到', + 'com.alibaba.nacos.page.form.Data_Id_can_not_be_empty': 'Data ID不能为空', + 'com.alibaba.nacos.page.listeningToQuery.group_can_not_be_empty': 'Group不能为空', + 'com.alibaba.nacos.page.configurationManagement.fuzzyg': '模糊查询请输入Group', + 'nacos.component.NameSpaceList.Forum': '论坛', + 'nacos.component.ShowCodeing.,_new_ConfigChangeListener()_{_public_void_receiveConfigInfo(String': '", new ConfigChangeListener() {\t\t\t\tpublic void receiveConfigInfo(String configInfo) {\t\t\t\t\t// 当配置更新后,通过该回调函数将最新值吐给用户。\t\t\t\t\t// 注意回调函数中不要做阻塞操作,否则阻塞通知线程。\t\t\t\t\tconfig = configInfo;\t\t\t\t\tSystem.out.println(configInfo);\t\t\t\t}\t\t\t});\t\t\t\t\t\t/**\t\t\t * 如果配置值的內容为properties格式(key=value), 可使用下面监听器。以便一个配置管理多个配置项\t\t\t */\t\t\t\t\t\t/**\t\t\tConfigService.addListener("', + 'com.alibaba.nacos.page.consistencyEfficacy.advanced_query': '高级查询', + 'com.alibaba.nacos.page.listeningToQuery.please_enter_the_dataid': '请输入Data ID', + 'nacos.component.ShowCodeing.,_6000);_System.out.println(content);_//_初始化的时候,给配置添加监听,配置变更会回调通知_ConfigService.addListener(': '", 6000);\t\t\tSystem.out.println(content);\t\t\t// 初始化的时候,给配置添加监听,配置变更会回调通知\t\t\tConfigService.addListener("', + 'nacos.component.CloneDialog.|_the_selected_entry': '| 选中的条目', + 'nacos.page.newconfig.Data_encryption0': '数据加密', + 'com.alibaba.nacos.page.environmentalManagement.environment_marked': '环境标示', + 'com.alibaba.nacos.page.listeningToQuery.listener_query': '监听查询', + 'nacos.component.ExportDialog.|_The_selected_entry0': '| 选中的条目', + 'com.alibaba.nacos.page.consistencyEfficacy.query_results': '查询结果', + 'nacos.page.namespace.deleted_successfully': '删除成功', + 'nacos.component.CloneDialog.cover': '覆盖', + 'com.alibaba.nacos.page.environmentalManagement.Into_the': '进入', + 'com.alibaba.nacos.page.configdetail.more_advanced_options': '更多高级选项', + 'com.alibaba.nacos.page.listeningToQuery.query_dimension': '查询维度:', + 'com.alibaba.nacos.page.configRollback.configuration': '配置内容:', + 'com.alibaba.nacos.page.historyDetail.more_advanced_options': '更多高级选项', + 'com.alibaba.nacos.page.consistencyEfficacy.query': '查询', + 'com.alibaba.nacos.page.listeningToQuery.please_input_ip': '请输入IP', + 'com.alibaba.nacos.component.NewDatePicker.end_time_must_be_greater_than_the_start_time_of_the_t': '结束时间必须大于开始时间', + 'com.alibaba.nacos.page.listAllEnvironmental.view': '查看', + 'nacos.component.ShowCodeing.*///_ConfigService.init();_//_主动获取配置_String_content_=_ConfigService': '*///\t\t\tConfigService.init();\t\t\t\t\t\t// 主动获取配置\t\t\tString content = ConfigService.getConfig("', + 'com.alibaba.nacos.page.newconfig.configure_contents_of': '按F1显示全屏', + 'com.alibaba.nacos.page.listeningToQuery.success': '成功', + 'com.alibaba.nacos.component.NewDatePicker.30_minutes': '30分钟', + 'com.alibaba.nacos.page.historyDetail.history_details': '历史详情', + 'com.alibaba.nacos.page.listeningToQuery.query': '查询', + 'com.alibaba.nacos.page.newconfig.the_target_environment': '配置格式:', + 'com.alibaba.nacos.layout.noenv.does_not_exist': '您访问的页面不存在', + 'nacos.component.ImportDialog.file_upload_directly_after_importing_the_configuration,_please_be_': '文件上传后将直接导入配置,请务必谨慎操作', + 'nacos.page.configurationManagement.ACM_dedicated_AccessKey_will_the_waste,_does_not_recommend_the_use_of5': 'ACM专用AccessKey(即将废弃,不建议使用):', + 'nacos.page.configurationManagement.import': '导入', + 'com.alibaba.nacos.page.configurationManagement.suredelete': '确定要删除以下配置吗?', + 'com.alibaba.nacos.page.configeditor.release_beta': '按Esc退出全屏', + 'nacos.page.configurationManagement.no_announcement6': '暂无公告', + 'com.alibaba.nacos.component.NewDatePicker.query_range:': '自定义', + 'com.alibaba.nacos.page.configRollback.belongs_to': '所属地域:', + 'com.alibaba.nacos.page.pushTrajectory.query_dimension:': '查询维度:', + 'com.alibaba.nacos.component.MiddleWareEnv.payTM_daily': 'payTM日常', + 'nacos.page.configurationManagement.ACM_special_SecretKey_will_be_abandoned,_not_recommended_for_use6': 'ACM专用SecretKey(即将废弃,不建议使用):', + 'com.alibaba.nacos.page.configurationManagement.query': '查询', + 'com.alibaba.nacos.component.MiddleWareEnv.offline': '线下', + 'com.alibaba.nacos.page.listeningToQuery.article_meet_the_requirements_of_the_configuration.': '条满足要求的配置。', + 'com.alibaba.nacos.page.configurationManagement.Remove_configuration': '删除配置', + recent: '最近', + 'com.alibaba.nacos.page.configeditor.F1/fn F1(MAC)full_screen': '配置内容', + 'nacos.page.configurationManagement.off_the_Bulletin_Board5': '关闭公告栏', + 'com.alibaba.nacos.page.historyDetail.action_type': '操作类型:', + 'com.alibaba.nacos.page.listAllEnvironmental.environment_IP': '环境IP', + 'nacos.component.CloneDialog.source_space': '源空间:', + 'nacos.page.configurationManagement.click_on_the_obtain_of3': '点击获取 》', + 'com.alibaba.nacos.page.configurationManagement.article_meet_the_requirements': '条满足要求的配置。', + 'com.alibaba.nacos.page.historyRollback.operation': '操作', + 'nacos.component.ShowCodeing.);_/**_*_生产环境通过jvm参数传参,以便使用多个环境,_-Dacm.endpoint=': '");\t\t\t\t\t\t/**\t\t\t * 生产环境通过JVM参数传参,以便使用多个环境, -Dacm.endpoint=', + 'com.alibaba.nacos.page.historyDetail.return': '返回', + 'nacos.page.configurationManagement.failed_entry': '失败的条目:', + 'nacos.component.CloneDialog.start_cloning': '开始克隆', + 'com.alibaba.nacos.page.configRollback.the_following_configuration': '以下配置吗?', + 'com.alibaba.nacos.page.configurationManagement.query_results': '查询结果:共查询到', + 'nacos.page.configurationManagement.a_ACM_front-end_monitoring_questionnaire,_the_time_limit_to_receive_Ali_cloud_voucher_details_shoved_stamp_the3': '答 ACM 前端监控调查问卷,限时领取阿里云代金券\t 详情猛戳:', + 'com.alibaba.nacos.component.MiddleWareEnv.online_center': '线上中心', + 'com.alibaba.nacos.page.serviceManagement.service_list': '服务列表', + 'com.alibaba.nacos.page.serviceManagement.service_name': '服务名称', + 'com.alibaba.nacos.page.serviceManagement.please_enter_the_service_name': '请输入服务名称', + 'com.alibaba.nacos.page.serviceManagement.table.column.service_name': '服务名', + 'com.alibaba.nacos.page.serviceManagement.table.column.cluster_count': '集群数目', + 'com.alibaba.nacos.page.serviceManagement.table.column.ip_count': '实例数', + 'com.alibaba.nacos.page.serviceManagement.table.column.health_status': '健康实例数', + 'com.alibaba.nacos.page.serviceManagement.table.column.operation': '操作', + 'com.alibaba.nacos.page.serviceManagement.detail': '详情', + 'com.alibaba.nacos.page.serviceManagement.delete': '删除', + 'com.alibaba.nacos.page.serviceManagement.prompt': '提示', + 'com.alibaba.nacos.page.serviceManagement.prompt_delete': '确定要删除当前服务吗?', + 'com.alibaba.nacos.page.serviceManagement.create': '创建服务', + 'com.alibaba.nacos.page.serviceManagement.query': '查询', + serviceManagement: '服务列表', + 'com.alibaba.nacos.page.serviceDetail.service_details': '服务详情', + 'com.alibaba.nacos.page.serviceDetail.edit_service': '编辑服务', + 'com.alibaba.nacos.page.serviceDetail.back': '返回', + 'com.alibaba.nacos.page.serviceDetail.service_name': '服务名', + 'com.alibaba.nacos.page.serviceDetail.protect_threshold': '保护阀值', + 'com.alibaba.nacos.page.serviceDetail.health_check_pattern': '健康检查模式', + 'com.alibaba.nacos.page.serviceDetail.health_check_pattern.service': '服务端', + 'com.alibaba.nacos.page.serviceDetail.health_check_pattern.client': '客户端', + 'com.alibaba.nacos.page.serviceDetail.health_check_pattern.none': '禁止', + 'com.alibaba.nacos.page.serviceDetail.metadata': '元数据', + 'com.alibaba.nacos.page.serviceDetail.create_service': '创建服务', + 'com.alibaba.nacos.page.serviceDetail.update_service': '更新服务', + 'com.alibaba.nacos.page.serviceDetail.cluster': '集群', + 'com.alibaba.nacos.page.serviceDetail.edit_cluster': '集群配置', + 'com.alibaba.nacos.page.serviceDetail.port': '端口', + 'com.alibaba.nacos.page.serviceDetail.weight': '权重', + 'com.alibaba.nacos.page.serviceDetail.healthy': '健康状态', + 'com.alibaba.nacos.page.serviceDetail.operation': '操作', + 'com.alibaba.nacos.page.serviceDetail.editor': '编辑', + 'com.alibaba.nacos.page.serviceDetail.offline': '下线', + 'com.alibaba.nacos.page.serviceDetail.online': '上线', + 'com.alibaba.nacos.page.serviceDetail.check_type': '检查类型', + 'com.alibaba.nacos.page.serviceDetail.check_port': '检查端口', + 'com.alibaba.nacos.page.serviceDetail.use_ip_port_check': '使用IP端口检查', + 'com.alibaba.nacos.page.serviceDetail.check_path': '检查路径', + 'com.alibaba.nacos.page.serviceDetail.check_headers': '检查头', + 'com.alibaba.nacos.page.serviceDetail.update_cluster': '更新集群', + 'com.alibaba.nacos.page.serviceDetail.update_instance': '编辑实例', + 'com.alibaba.nacos.page.serviceDetail.whether_online': '是否上线', + serviceDetail: '服务详情', + 'nacos.page.ConfigEditor.submit_failed': '不能为空, 提交失败', }, - "en-us": { - "com.alibaba.nacos.layout.noenv.nacosversion": "0.4.0", - "com.alibaba.nacos.page.configurationManagementVirtual": "ConfigManagement", - "com.alibaba.nacos.page.serviceManagementVirtual": "ServiceManagement", - "nacos.component.CloneDialog.the_same_configuration": "Conflict:", - "to": "to", - "nacos.page.newconfig.data_encryption3": "Data Encryption:", - "nacos.page.configurationManagement.batch_management": "Batch Operation", - "com.alibaba.nacos.page.configsync.return": "Back", - "com.alibaba.nacos.page.pushTrajectory.getconfig": "Get Configuration", - "cancel": "Cancel", - "nacos.component.CloneDialog.Terminate_the_clone0": "Terminate", - "com.alibaba.nacos.component.NewNameSpace.newnamespce": "Create Namespace", - "com.alibaba.nacos.page.pushTrajectory.Data_Id_can_not_be_empty": "Data ID cannot be empty", - "com.alibaba.nacos.component.MiddleWareEnv.maletest": "male. test", - "com.alibaba.nacos.page.configeditor.group_is_not_empty": "Advanced Options", - "com.alibaba.nacos.component.editorNameSpace": "Dedicated Space", - "nacos.component.CloneDialog.target_space": "Target:", - "nacos.page.newconfig.off1": "Off", - "com.alibaba.nacos.component.NameSpaceList.Announcement_nodejs_version_is_developed,supports_a_c": "Announcement: Node.js version now available, supporting customized messages.", - "com.alibaba.nacos.page.pushTrajectory.user_Ip": "User IP:", - "nacos.page.configurationManagement.a_ACM_front-end_monitoring_questionnaire,_the_time_limit_to_": "a ACM front-end monitoring questionnaire, the time limit to receive Ali cloud voucher details shoved stamp: the", - "nacos.page.configurationManagement.Important_reminder0": "Important reminder", - "com.alibaba.nacos.page.pushTrajectory.the_query_results:_a_total_query_to": "Results: Found", - "com.alibaba.nacos.page.configdetail.belongs_to_the_environment": "Region:", - "com.alibaba.nacos.page.configurationManagement.operation": "Actions", - "com.alibaba.nacos.layout.noenv.app_configuration_management_ACM": "NACOS", - "nacos.page.namespace.note_ACM_is_dedicated_AK/SK_is_mainly_used_for_some_of_the_compatibility_scenario,_it_is_recommended_to_Unified_the_use_of_Ali_cloud_AK/SK.5": "Note: ACM's dedicated AK/SK is mainly used for improved compatibilities. We recommend that you always use Alibaba Cloud AK/SK.", - "com.alibaba.nacos.component.ShowCodeing.Sample_code": "Sample Code", - "nacos.page.newconfig.Open0": "Open", - "custom": "Customize", - "com.alibaba.nacos.page.pushTrajectory.Group_Id_cannot_be_empty": "Group name cannot be empty", - "com.alibaba.nacos.page.environmentalManagement.operation": "operation", - "com.alibaba.nacos.page.configRollback.environment": "Region:", - "com.alibaba.nacos.page.pushTrajectory.please_enter_a_query_Ip": "Enter IP", - "confirm": "OK", - "nacos.page.configurationManagement.successful_entry": "Successful Entry:", - "com.alibaba.nacos.page.configurationManagement.configuration_query": "Configuration Search", - "nacos.page.configurationManagement._Details_of8": " Details of", - "com.alibaba.nacos.page.namespace.add": "Create Namespace", - "nacos.component.ImportDialog.the_same_configuration6": "Conflict:", - "com.alibaba.nacos.page.pushTrajectory.Push_the_trajectory": "Push Tracks", - "configsync": "Synchronize Configuration", - "nacos.page.namespace.Namespace_details": "Namespace details", - "dateinfo1": "The end time must be greater than the start time", - "com.alibaba.nacos.page.newconfig.group_is_not_empty": "Group ID cannot exceed 127 characters in length", - "com.alibaba.nacos.page.configurationManagement.click_to_learn_DataId": "Learn more about Data ID", - "com.alibaba.nacos.page.configdetail.configuration_details": "Configuration Details", - "com.alibaba.nacos.page.namespace.edit": "Edit", - "nacos.page.newconfig.Tags": "Tags:", - "nacos.page.configurationManagement.please_choose_the_required_export_configuration_items10": "Please select configuration items to export.", - "nacos.page.namespace.namespace_name": "Name:", - "com.alibaba.nacos.component.MiddleWareEnv.ungrouped": "Ungrouped", - "nacos.component.ImportDialog.target_space5": "Target:", - "com.alibaba.nacos.page.pushTrajectory.configok": "New Configuration Published", - "com.alibaba.nacos.page.newconfig.esc_exit": "Publish", - "nacos.page.namespace.ACM_dedicated_AccessKey_will_the_waste,_does_not_recommend_the_use_of3": "ACM dedicated AccessKey will the waste, does not recommend the use of:", - "nacos.page.configurationManagement.ACM_dedicated_AccessKey_will_the_waste,_does_not_recommend_t": "ACM dedicated AccessKey will the waste, does not recommend the use of:", - "com.alibaba.nacos.page.newconfig.the_more_advanced": "Group cannot be empty", - "nacos.page.configurationManagement.SecretKey_recommended5": "SecretKey (Recommended for development environment):", - "nacos.page.configurationManagement.Configuration_cloning0": "Clone", - "com.alibaba.nacos.page.pushTrajectory.configuration": "Configuration", - "com.alibaba.nacos.page.newconfig.new_listing_main": "Create Configuration", - "nacos.page.configurationManagement.Batch_processing0": "Batch processing", - "com.alibaba.nacos.page.configeditor.look": "View Push Track", - "com.alibaba.nacos.page.configsync.sync_configuration": "Synchronize Configuration Successfully", - "com.alibaba.nacos.page.configeditor.official": "Official", - "nacos.page.configeditor.Data_encryption0": "Data encryption", - "nacos.component.NameSpaceList.Announcement_nodejs_version_is_developed,supports_a_custom_messag": "Announcement: Node.JS version now available, supporting customized messages.", - "com.alibaba.nacos.page.historyDetail.update": "Update", - "com.alibaba.nacos.page.pushTrajectory.user_IP": "IP", - "nacos.component.ImportDialog.Upload_File3": "Upload File", - "com.alibaba.nacos.component.NewDatePicker.60_-_": "60 minutes", - "nacos.page.configurationManagement.note_ACM_is_dedicated_AK/SK_is_mainly_used_for_some_of_the_c": "note: ACM is dedicated AK/SK is mainly used for some of the compatibility scenario, it is recommended to Unified the use of Ali cloud AK/SK.", - "com.alibaba.nacos.page.newconfig.Data_ID_length": "Collapse", - "nacos.page.configurationManagement.Please_enter_the_name_of_the_app1": "Enter App Name\n", - "com.alibaba.nacos.page.configeditor.toedittitle": "Edit Configuration", - "nacos.component.CloneDialog.configuration_number": "Items:", - "chaxunfanwei": "Query Range", - "com.alibaba.nacos.page.configeditor.beta_release_notes(default_not_checked)": "Beta Publish:", - "nacos.page.configurationManagement.open_Bulletin_Board7": "open Bulletin Board", - "com.alibaba.nacos.component.SuccessDialog.failure": "Failed", - "com.alibaba.nacos.component.ShowCodeing.loading": "Loading...", - "com.alibaba.nacos.page.configsync.home": "Application:", - "minute": " minutes", - "cspupcloud.page.historyRollback.Retained_for_30_days": "Retained for 30 days", - "com.alibaba.nacos.page.configRollback.delete": "Delete", - "com.alibaba.nacos.page.configeditor.beta_release:": "Target Region:", - "com.alibaba.nacos.page.consistencyEfficacy.environment_name": "environment name", - "com.alibaba.nacos.component.SuccessDialog.success": "Successful", - "com.alibaba.nacos.page.namespace.configuration": "Number of Configurations", - "hour": " hours", - "com.alibaba.nacos.page.configRollback.please_confirm_rollback": "Roll Back", - "nacos.page.configurationManagement.ACM_special_SecretKey_will_be_abandoned,_not_recommended_for_use6": "ACM's dedicated SecretKey (To be deprecated soon and not recommended):", - "nacos.component.ExportDialog.source_space5": "Source:", - "com.alibaba.nacos.component.SuccessDialog.determine": "OK", - "com.alibaba.nacos.component.EnvConfigTopBar.context_switching": "Switch Region", - "nacos.component.DeleteDialog.delete_the_configuration_failed": "Deleting configuration failed", - "com.alibaba.nacos.page.configurationManagement.more": "More", - "com.alibaba.nacos.page.pushTrajectory.please_enter_the_dataID": "Enter Data ID", - "com.alibaba.nacos.page.configRollback.inserted": "Insert", - "com.alibaba.nacos.page.configeditor.Home_application:": "Group name cannot be empty", - "com.alibaba.nacos.page.configurationManagement.environment": "Region:", - "com.alibaba.nacos.component.NewNameSpace.prompt": "Notice", - "com.alibaba.nacos.page.configurationManagement.push_track": "Push Track", - "hanxie.show": "test", - "com.alibaba.nacos.page.configdetail.configuration": "Configuration Content:", - "com.alibaba.nacos.pubshow": "The sub-account is not anthorized. Contact the owner of the primary account to grant permission first.", - "com.alibaba.nacos.page.newconfig.stop_fails": "Failed to stop beta publishing.", - "com.alibaba.nacos.page.newconfig.group_placeholder": "Enter your group name", - "nacos.page.namespace._Remove_the_namespace_success": " Remove the namespace success", - "com.alibaba.nacos.component.MiddleWareEnv.from-test": "Self-Test", - "com.alibaba.nacos.component.EditorNameSpace.public_space": "OK", - "com.alibaba.nacos.page.consistencyEfficacy.details": "Details", - "com.alibaba.nacos.page.configeditor.vdchart": "Illegal characters not allowed", - "nacos.page.configurationManagement.Please_enter_application_name1": "Enter App Name", - "com.alibaba.nacos.page.pushTrajectory.query_dimension:": "Dimension:", - "nacos.page.namespace.sure_you_want_to_delete_the_following_namespaces?": "Sure you want to delete the following namespaces?", - "nacos.component.ImportDialog.cover2": "Overwrite", - "com.alibaba.nacos.component.MiddleWareEnv.daily_stable": "Daily Stable", - "com.alibaba.nacos.component.EditorNameSpace.edit_namespace": "Loading...", - "com.alibaba.nacos.page.newconfig.dataId_is_not_empty": "Data ID cannot exceed 255 characters in length", - "com.alibaba.nacos.page.configurationManagement.article_meet_the_requirements": "configuration items", - "com.alibaba.nacos.component.NewNameSpace.name": "Namespace:", - "com.alibaba.nacos.page.configeditor.more_advanced_options": "Collapse", - "com.alibaba.nacos.page.historyRollback.details": "Details", - "nacos.page.newconfig._to_go_to_the_opening_of1": " to go to the opening of", - "nacos.page.configurationManagement.please_select_the_required_delete_the_configuration_item": "Select configuration items to delete", - "nacos.component.DeleteDialog.deletetitle": "Delete Configuration", - "com.alibaba.nacos.page.configeditor.recipient_from": "Data ID cannot be empty", - "nacos.page.namespace.namespace_ID": "ID:", - "com.alibaba.nacos.component.MiddleWareEnv.Spas_dedicated": "Spas Dedicated", - "historyRollback": "Historical Versions", - "com.alibaba.nacos.page.newconfig.full_screen": "Press Esc to exit", - "com.alibaba.nacos.page.listAllEnvironmental.environment_marked": "environment marked", - "nacos.page.namespace.delete_failed": "Failed to Delete", - "com.alibaba.nacos.page.configsync.configuration": "Configuration Content:", - "configeditor": "Edit Configuration", - "com.alibaba.nacos.component.NameSpaceList.immediate_use": "Try Now", - "com.alibaba.nacos.page.configRollback.rollback": "Roll Back", - "com.alibaba.nacos.page.configeditor.configuration_format:": "Deselected by default. Learn more about beta publishing.\n", - "com.alibaba.nacos.page.listAllEnvironmental.environment_name": "environment name,", - "com.alibaba.nacos.page.configeditor.": "Back", - "nacos.component.validateDialog.Click_to_get_verification_code": "Click to Get Verification Code", - "configRollback": "Configuration Rollback", - "com.alibaba.nacos.component.NameSpaceList.Announcement_nodejs_version_is_developed,supports_a_custom_message": "Announcement: Node.js version now available, supporting customized messages.", - "nacos.page.configurationManagement.advanced_query9": "Advanced Query", - "com.alibaba.nacos.page.configdetail.official": "Official", - "nacos.page.configurationManagement.process_is_successful,_the_cloned": "Process successfully, cloned ", - "nacos.component.ShowCodeing.,_new_PropertiesListener()_{_@Override_public_void_innerReceive(Pro": "\", new PropertiesListener() {\t\t\t\t\t\t\t\t@Override\t\t\t\tpublic void innerReceive(Properties properties) {\t\t\t\t\t// TODO Auto-generated method stub\t\t\t\t\tacmProperties = properties;\t\t\t\t\tSystem.out.println(properties);\t\t\t\t}\t\t\t});\t\t\t\t\t\t**/\t\t\t\t\t} catch (ConfigException e) {\t\t\te.printStackTrace();\t\t}\t\t// 测试让主线程不退出,因为订阅配置是守护线程,主线程退出守护线程就会退出。 正式代码中无需下面代码\t\twhile (true) {\t\t\ttry {\t\t\t\tThread.sleep(1000);\t\t\t} catch (InterruptedException e) {\t\t\t\te.printStackTrace();\t\t\t}\t\t}\t}\t // 通过get接口把配置值暴露出去使用 public static String getConfig() { return config; } \t// 通过get接口把配置值暴露出去使用\tpublic static Object getPorpertiesValue(String key) {\t\tif (acmProperties != null) {\t\t\treturn acmProperties.get(key);\t\t}\t\treturn null;\t}}", - "com.alibaba.nacos.page.listeningToQuery.query_dimension": "Dimension:", - "nacos.component.DeleteDialog.determine": "OK", - "com.alibaba.nacos.page.configurationManagement.details": "Details", - "pubnodata": "No results found.", - "configdetail": "Configuration Details", - "com.alibaba.nacos.page.configurationManagement.edit": "Edit", - "com.alibaba.nacos.page.listAllEnvironmental.view_environment_IP": "View environment IP", - "com.alibaba.nacos.page.historyDetail.home": "Application:", - "com.alibaba.nacos.page.configeditor.configuration_formatpre": "Deselected by default. ", - "com.alibaba.nacos.component.AddGroup.prompt": "Notice", - "com.alibaba.nacos.page.consistencyEfficacy.configuration_content_md5": "Configuration Content MD5", - "com.alibaba.nacos.component.NameSpaceList.online_customer_support": "Online Customer Support:", - "nacos.page.configurationManagement.Delete_failed": "Delete failed", - "com.alibaba.nacos.page.consistencyEfficacy.edit": "Edit", - "nacos.component.ExportDialog.HOME_Application1": "Application:", - "com.alibaba.nacos.page.configurationManagement.fuzzyd": "Enter Data ID", - "com.alibaba.nacos.page.listeningToQuery.query": "Search", - "com.alibaba.nacos.component.MiddleWareEnv.daily_environment_packet": "Daily Environment Group", - "com.alibaba.nacos.component.NewDatePicker.to": "Search Range:", - "nacos.component.ExportDialog.export3": "Export", - "com.alibaba.nacos.layout.noenv.Click_to_learn_the_namespace": "Learn more about namespace", - "com.alibaba.nacos.page.pushTrajectory.determine": "Search", - "com.alibaba.nacos.page.historyRollback.dataid": "Enter Data ID", - "nacos.page.namespace.SecretKey_recommended3": "SecretKey (Recommended for development environment):", - "com.alibaba.nacos.page.historyDetail.insert": "Insert", - "com.alibaba.nacos.component.MiddleWareEnv.daily_units": "Daily Units", - "nacos.component.validateDialog.confirm": "confirm", - "com.alibaba.nacos.component.EditorNameSpace.please_do": "Illegal characters not allowed", - "nacos.page.configurationManagement.view_details1": "view details", - "com.alibaba.nacos.component.NewDatePicker.to_cancel_the": "OK", - "nacos.component.validateDialog.phoneNumber": "Mobile phone number:", - "com.alibaba.nacos.page.newconfig.Group_ID_cannot_be_longer": "Application:", - "nacos.page.newconfig.The_opening_of_the_data_encryption-related_services0": "The Opening of the Data Encryption-Related Services", - "com.alibaba.nacos.component.MiddleWareEnv.cloud_unit": "Cloud Unit", - "com.alibaba.nacos.component.NewDatePicker.recently": "Cancel", - "nacos.page.namespace.Namespace": "Namespaces", - "com.alibaba.nacos.page.listAllEnvironmental.operation": "operation", - "nacos.page.configurationManagement.select_need_to_clone_the_configuration_items1": "Please select configuration items to clone.", - "nacos.page.configurationManagement.ACM_dedicated_AccessKey_will_the_waste,_does_not_recommend_the_use_of5": "ACM's dedicated AccessKey (To be deprecated soon and not recommended):", - "nacos.component.CloneDialog.tags": "tags:", - "com.alibaba.nacos.component.NewNameSpace.confirm": "OK", - "com.alibaba.nacos.page.configRollback.home": "Application:", - "nacos.page.configurationManagement.a_ACM_front-end_monitoring_questionnaire,_the_time_limit_to_receive_Ali_cloud_voucher_details_shoved_stamp_the3": "a ACM front-end monitoring questionnaire, the time limit to receive Ali cloud voucher details shoved stamp: the", - "com.alibaba.nacos.page.configeditor.Esc_exit": "Press F1 to view in full screen", - "nacos.page.configurationManagement.click_on_the_obtain_of3": "Click on the obtain of", - "com.alibaba.nacos.page.listAllEnvironmental.view": "View", - "nacos.page.configeditor.Description": "Description:", - "com.alibaba.nacos.page.historyDetail.belongs_to_the_environment": "Region:", - "nacos.page.configurationManagement.off_the_Bulletin_Board5": "off the Bulletin Board", - "com.alibaba.nacos.page.configeditor.release_beta": "Press Esc to exit ", - "com.alibaba.nacos.page.configurationManagement.Remove_configuration": "Delete Configuration", - "nacos.page.namespace.deleted_successfully": "Deleted successfully", - "nacos.component.CloneDialog.configuration_cloning(": "Clone(", - "com.alibaba.nacos.page.configRollback.configuration": "Configuration Content:", - "com.alibaba.nacos.component.DiffEditorDialog.original_value": "Original Value", - "com.alibaba.nacos.page.historyDetail.return": "Back", - "com.alibaba.nacos.page.configeditor.configure_contents_of": "Format:", - "com.alibaba.nacos.page.listeningToQuery.article_meet_the_requirements_of_the_configuration.": "configuration items.", - "com.alibaba.nacos.page.configurationManagement.query": "Search", - "com.alibaba.nacos.page.historyRollback.last_update_time": "Last Modified At", - "nacos.component.CloneDialog.source_space": "Source :", - "nacos.component.ShowCodeing.);_/**_*_生产环境通过jvm参数传参,以便使用多个环境,_-Dacm.endpoint=": "\");\t\t\t\t\t\t/**\t\t\t * 生产环境通过JVM参数传参,以便使用多个环境, -Dacm.endpoint=", - "com.alibaba.nacos.layout.noenv.does_not_exist": "The page you visit does not exist", - "com.alibaba.nacos.page.historyDetail.configure_content": "Configuration Content:", - "nacos.component.ShowCodeing.*///_ConfigService.init();_//_主动获取配置_String_content_=_ConfigService.getConfig(": "*///\t\t\tConfigService.init();\t\t\t\t\t\t// 主动获取配置\t\t\tString content = ConfigService.getConfig(\"", - "com.alibaba.nacos.page.configurationManagement.query_results": "Search Results: Found", - "nacos.component.ShowCodeing.,_new_ConfigChangeListener()_{_public_void_receiveConfigInfo(String": "\", new ConfigChangeListener() {\t\t\t\tpublic void receiveConfigInfo(String configInfo) {\t\t\t\t\t// 当配置更新后,通过该回调函数将最新值吐给用户。\t\t\t\t\t// 注意回调函数中不要做阻塞操作,否则阻塞通知线程。\t\t\t\t\tconfig = configInfo;\t\t\t\t\tSystem.out.println(configInfo);\t\t\t\t}\t\t\t});\t\t\t\t\t\t/**\t\t\t * 如果配置值的內容为properties格式(key=value), 可使用下面监听器。以便一个配置管理多个配置项\t\t\t */\t\t\t\t\t\t/**\t\t\tConfigService.addListener(\"", - "com.alibaba.nacos.page.consistencyEfficacy.advanced_query": "Advanced Query", - "com.alibaba.nacos.page.historyDetail.delete": "Delete", - "nacos.component.NameSpaceList.Forum": "Forum", - "com.alibaba.nacos.page.namespace.prompt": "Notice", - "com.alibaba.nacos.page.configdetail.more_advanced_options": "Advanced Options", - "com.alibaba.nacos.page.listeningToQuery.listener_query": "Listening Query", - "com.alibaba.nacos.page.newconfig.the_home_application": "Target Region:", - "nacos.page.namespace.click_on_the_obtain_of1": "Click on the obtain of", - "nacos.component.NameSpaceList.Quick_to_learn0": "Learning Path", - "nacos.component.CloneDialog.get_the_namespace_failed": "get the namespace failed", - "com.alibaba.nacos.component.EditorNameSpace.namespace": "Namespace cannot be empty", - "nacos.component.validateDialog.remark": "Tip: The verification code will be sent through SMS to your bound phone number.", - "com.alibaba.nacos.page.consistencyEfficacy.query": "Query", - "com.alibaba.nacos.page.environmentalManagement.environment_name": "environment name,", - "com.alibaba.nacos.page.listAllEnvironmental.environment_IP": "environment IP", - "com.alibaba.nacos.page.listeningToQuery.success": "Success", - "nacos.component.CloneDialog.|_the_selected_entry": "| Selected entry", - "com.alibaba.nacos.component.MiddleWareEnv.offline": "Offline", - "com.alibaba.nacos.page.listeningToQuery.please_input_ip": "Enter IP", - "com.alibaba.nacos.page.historyDetail.recipient_from": "Collapse", - "com.alibaba.nacos.page.newconfig.configuration_format": "Configuration Content", - "com.alibaba.nacos.component.NewDatePicker.query_range:": "Customize", - "nacos.component.CloneDialog.skip": "Skip", - "com.alibaba.nacos.page.listeningToQuery.please_enter_the_dataid": "Enter Data ID", - "com.alibaba.nacos.component.NewDatePicker.7_day": "7 days", - "nacos.component.ShowCodeing.-Dproject.name=acmtest_-Dspas.identity=CUserswater.lyl.spas_keyacmt": "-Dproject.name=acmtest -Dspas.identity=C:Userswater.lyl.spas_keyacmtest\t\t\t * 在本地的acmtest文件中填写accessKey/secretKey,格式如下\t\t\t * accessKey=", - "com.alibaba.nacos.service.fill_the_code": "Please fill out the verification code", - "com.alibaba.nacos.page.historyDetail.more_advanced_options": "Advanced Options", - "com.alibaba.nacos.page.newconfig.configure_contents_of": "Press F1 to view in full screen", - "nacos.component.ImportDialog.file_upload_directly_after_importing_the_configuration,_please_be_": "Caution: Data will be imported directly after uploading.", - "com.alibaba.nacos.page.newconfig.configuration_contentmax": "Configuration content cannot exceed 10240 characters in length", - "com.alibaba.nacos.page.listAllEnvironmental.all_available_environment": "all available environment", - "nacos.page.configurationManagement.configuration_management8": "configuration management", - "com.alibaba.nacos.component.NewDatePicker.": "Last", - "nacos.page.configurationManagement.configuration": " configuration", - "nacos.page.configurationManagement._The_process_is_successful,_delete_the": "Process successfully, delete ", - "com.alibaba.nacos.page.configsync.target": "Target Region:", - "com.alibaba.nacos.page.newconfig.new_listing": "Create Configuration", - "Configdetail": "Configuration Details", - "nacos.page.configdetail.Tags": "Tags:", - "listeningToQuery": "Listening Query", - "nacos.page.configurationManagement.,_wherein": ", wherein ", - "com.alibaba.nacos.page.configRollback.retracted": "Collapse", - "nacos.component.validateDialog.title": "Account Security Verification", - "com.alibaba.nacos.page.configsync.belongs_to_the_environment": "Region:", - "com.alibaba.nacos.page.configeditor.return": "Publish", - "com.alibaba.nacos.page.historyRollback.queryresult": "Search Results: Found", - "com.alibaba.nacos.page.configurationManagement.the_sample_code": "Code Example", - "nacos.page.configurationManagement.Cloning_check_fails": "Cloning check fails", - "nacos.page.configurationManagement.process_is_successful,_import_the": "Process successfully, import ", - "com.alibaba.nacos.page.consistencyEfficacy.environment_marked": "environment marked", - "com.alibaba.nacos.page.namespace.namespace_names": "Namespaces ", - "nacos.page.namespace.details": "Details", - "com.alibaba.nacos.page.configdetail.error": "Error", - "com.alibaba.nacos.component.AddGroup.a_new_group": "Create Group", - "com.alibaba.nacos.component.DiffEditorDialog.contents": "Content Comparison", - "com.alibaba.nacos.page.configRollback.return": "Back", - "com.alibaba.nacos.page.configurationManagement.configuration_management": "Configurations", - "nacos.page.configurationManagement.import_failed": "Import Failed", - "com.alibaba.nacos.page.consistencyEfficacy.operation": "Actions", - "nacos.component.ExportDialog.configuration_number6": "Items:", - "com.alibaba.nacos.page.pushTrajectory.getconifg": "Configuration Push or Get Configuration", - "com.alibaba.nacos.page.environmentalManagement.view_environment_IP": "View environment IP", - "historyDetail": "History Details", - "com.alibaba.nacos.component.EditorNameSpace.private": "Public Space", - "com.alibaba.nacos.page.configdetail.beta_release": "Beta Publish:", - "com.alibaba.nacos.page.historyRollback.group": "Enter Group", - "com.alibaba.nacos.component.NameSpaceList.Prompt": "Notice", - "com.alibaba.nacos.page.pushTrajectory.the_query_results": "Search Results: Found", - "com.alibaba.nacos.page.pushTrajectory.used": "New Configuration Published", - "nacos.page.namespace._Details_of6": " Details of", - "nacos.page.namespace.namespace_number": "Namespace ID", - "com.alibaba.nacos.page.historyrollback.query": "Search", - "nacos.component.ExportDialog.tags2": "Tags:", - "nacos.page.configurationManagement.Please_enter_tag": "Enter Tag", - "nacos.component.ImportDialog.You_can_only_upload._zip_file_format0": "Only upload. zip file format", - "nacos.component.CloneDialog.|_the_selected_entry4": "| Selected Entry", - "com.alibaba.nacos.page.pushTrajectory.track": "push tracks.", - "nacos.page.configurationManagement.HOME_Application0": "Application:", - "com.alibaba.nacos.component.NewDatePicker.24_hours": "24 hours", - "com.alibaba.nacos.component.DiffEditorDialog.confirm_that_the": "Publish", - "com.alibaba.nacos.component.EditorNameSpace.prompt": "Notice", - "nacos.page.namespace.AccessKey_recommended1": "AccessKey (Recommended for development environment):", - "com.alibaba.nacos.page.configsync.sync": "Synchronize", - "com.alibaba.nacos.page.historyRollback.to_configure": "Historical Versions (Configuration record is retained for 30 days.)", - "com.alibaba.nacos.page.pushTrajectory.interval": "Time Range:", - "com.alibaba.nacos.component.MiddleWareEnv.daily": "Daily", - "pushTrajectory": "Push Tracks", - "com.alibaba.nacos.component.MiddleWareEnv.switch_environment": "Switch Environment", - "com.alibaba.nacos.component.NewDatePicker.determine": "to", - "nacos.page.configdetail.Open0": "Open", - "com.alibaba.nacos.page.historyRollback.article_meet": "configuration items.", - "com.alibaba.nacos.page.configeditor.release": "Beta Publish", - "nacos.page.newconfig.to_the_authorization_of2": "to the authorization of", - "com.alibaba.nacos.component.NewNameSpace.namespacenotnull": "Namespace cannot be empty", - "nacos.page.newconfig.Note_You_are_to_be_a_custom_packet_the_new_configuration,_make_sure_that_the_client_use_the_Pandora_version_higher_than_3._4._0,_otherwise_it_may_read_less_than_the_configuration.0": "Notice: You are going to add configuration to a new group, please make sure that the version of Pandora which clients are using is higher than 3.4.0, otherwise this configuration may be unreadable to clients.", - "com.alibaba.nacos.page.configRollback.action_type": "Action Type:", - "nacos.page.configurationManagement.SecretKey_recommended4": "SecretKey recommended:", - "nacos.component.validateDialog.cancel": "cancel", - "com.alibaba.nacos.component.AddGroup.group_name": "Group name:", - "nacos.page.configurationManagement.no_longer_display4": "no longer display:", - "com.alibaba.nacos.component.DiffEditorDialog.of_the_current_area": "Current Value", - "com.alibaba.nacos.page.configRollback.belongs_to": "Region:", - "com.alibaba.nacos.page.configeditor.F1/fn F1(MAC)full_screen": "Configuration Content", - "recent": "Last ", - "configurationManagement": "Configurations", - "com.alibaba.nacos.page.historyRollback.operation": "Actions", - "com.alibaba.nacos.page.historyDetail.action_type": "Action Type:", - "com.alibaba.nacos.component.MiddleWareEnv.online": "Online", - "nacos.page.configurationManagement.configuration_item?": "configuration items?", - "com.alibaba.nacos.page.pushTrajectory.configget": "Get Configuration", - "com.alibaba.nacos.page.listeningToQuery._Push_state": "Push Status", - "com.alibaba.nacos.page.listAllEnvironmental.Into_the": "Into the", - "com.alibaba.nacos.page.pushTrajectory.user_Ip:": "User IP:", - "nacos.component.CloneDialog.start_cloning": "Start Clone", - "com.alibaba.nacos.page.configurationManagement.new_listing": "Create Configuration", - "com.alibaba.nacos.component.MiddleWareEnv.online_center": "Online Center", - "nacos.component.ShowCodeing.-Dproject.name=acmtest_-Dspas.identity=CUserswater.lyl.spas_keyacmtest_*_在本地的acmtest文件中填写accessKey/secretKey,格式如下_*_accessKey=": "-Dproject.name=acmtest -Dspas.identity=C:Userswater.lyl.spas_keyacmtest\t\t\t * 在本地的acmtest文件中填写accessKey/secretKey,格式如下\t\t\t * accessKey=", - "com.alibaba.nacos.page.configRollback.for_more_advanced": "Advanced Options", - "com.alibaba.nacos.page.configurationManagement.last_modified_time": "Last Modified At", - "namespace": "Namespaces", - "nacos.page.configdetail.Data_encryption0": "Data encryption", - "com.alibaba.nacos.component.NewDatePicker.3_day": "3 days", - "nacos.component.ShowCodeing.package_com.alibaba.middleware.acm;import_java.util.Properties;impo": "package com.alibaba.middleware.acm;import java.util.Properties;import com.alibaba.edas.acm.ConfigService;import com.alibaba.edas.acm.exception.ConfigException;import com.alibaba.edas.acm.listener.ConfigChangeListener;import com.alibaba.edas.acm.listener.PropertiesListener;// 示例代码,仅用于示例测试public class ACMTest { // 属性/开关 private static String config = \"DefaultValue\";\t private static Properties acmProperties = new Properties(); \tpublic static void main(String[] args) {\t\ttry {\t\t\t\t\t\t// 本地调试模式。本机测试无法连接ACM服务集群,因此设置debug模式(该模式下获取值为null,不会进入回调函数)。\t\t\t// ConfigService.setDebug(true);\t\t\t\t\t\t// 初始化配置服务,控制台通过示例代码自动获取下面参数\t\t\tConfigService.init(\"", - "com.alibaba.nacos.page.consistencyEfficacy.query_results": "Search Results", - "com.alibaba.nacos.page.environmentalManagement.environment_marked": "environment marked", - "com.alibaba.nacos.page.listeningToQuery.failure": "Failure", - "com.alibaba.nacos.page.environmentalManagement.view": "View", - "com.alibaba.nacos.page.configdetail.home": "Application:", - "com.alibaba.nacos.page.pushTrajectory.please_enter": "Enter IP", - "com.alibaba.nacos.page.historyRollback.rollback": "Roll Back", - "nacos.page.configurationManagement.note_ACM_is_dedicated_AK/SK_is_mainly_used_for_some_of_the_compatibility_scenario,_it_is_recommended_to_Unified_the_use_of_Ali_cloud_AK/SK.7": "Note: ACM's dedicated AK/SK is mainly used for improved compatibilities. We recommend that you always use Alibaba Cloud AK/SK.", - "com.alibaba.nacos.page.consistencyEfficacy.reset": "Reset", - "nacos.component.ExportDialog.export_configuration4": "Export ( ", - "com.alibaba.nacos.page.environmentalManagement.environment_ip": "environment IP", - "com.alibaba.nacos.component.MiddleWareEnv.new_diamond": "Diamond(New Version)", - "com.alibaba.nacos.page.environmentalManagement.Into_the": "Into the", - "com.alibaba.nacos.page.configdetail.recipient_from": "Collapse", - "com.alibaba.nacos.page.configurationManagement.listener_query": "Configuration Listening Query", - "com.alibaba.nacos.page.configurationManagement.suredelete": "Are you sure you want to delete the following configuration?", - "nacos.component.CloneDialog.cover": "Cover", - "nacos.page.configdetail.Description": "Description:", - "com.alibaba.nacos.component.NewDatePicker.end_time_must_be_greater_than_the_start_time_of_the_t": "The end time must be after the starttime", - "nacos.component.ShowCodeing.*///_ConfigService.init();_//_主动获取配置_String_content_=_ConfigService": "*///\t\t\tConfigService.init();\t\t\t\t\t\t// 主动获取配置\t\t\tString content = ConfigService.getConfig(\"", - "com.alibaba.nacos.page.environmentalManagement.all_available_environment": "all available environment", - "nacos.page.configurationManagement.no_announcement6": "no announcement", - "com.alibaba.nacos.page.listeningToQuery.please_input_group": "Enter Group", - "com.alibaba.nacos.page.configsync.for_more_advanced_options": "Advanced Options", - "com.alibaba.nacos.page.historyDetail.history_details": "History Details", - "com.alibaba.nacos.component.NewDatePicker.custom": "The time range cannot exceed 45 days", - "nacos.component.ShowCodeing.,_6000);_System.out.println(content);_//_初始化的时候,给配置添加监听,配置变更会回调通知_C": "\", 6000);\t\t\tSystem.out.println(content);\t\t\t// 初始化的时候,给配置添加监听,配置变更会回调通知\t\t\tConfigService.addListener(\"", - "nacos.component.validateDialog.Please_fill_out_the_verification_code": "Enter the verification code:", - "com.alibaba.nacos.page.newconfig.the_target_environment": "Format:", - "nacos.page.configurationManagement.questionnaire2": "questionnaire", - "nacos.page.configdetail.off1": "off", - "nacos.page.configurationManagement.clone": "Clone", - "com.alibaba.nacos.component.MiddleWareEnv.daily_test_center": "Daily Test Center", - "com.alibaba.nacos.page.configRollback.the_following_configuration": "the following configuration?", - "nacos.page.configurationManagement.failed_entry": "Failed Entry:", - "com.alibaba.nacos.component.NewNameSpace.cancel": "Cancel", - "nacos.component.CloneDialog.select_namespace": "Select Namespace", - "nacos.page.configurationManagement.export": "Export", - "nacos.page.configurationManagement.AccessKey_recommended2": "AccessKey recommended:", - "com.alibaba.nacos.component.MiddleWareEnv.line": "Online/", - "com.alibaba.nacos.component.NewNameSpace.loading": "Loading...", - "nacos.page.newconfig.Note_You_are_to_be_a_custom_packet_the_new_configuration,_make_sure_that_t": "Note: You are to be a custom packet the new configuration, make sure that the client use the Pandora version higher than 3. 4. 0, otherwise it may read less than the configuration.", - "com.alibaba.nacos.page.configurationManagement.fuzzyg": "Enter Group", - "com.alibaba.nacos.page.pushTrajectory.interval:": "Time Range:", - "nacos.component.ImportDialog.skip1": "Skip", - "com.alibaba.nacos.page.listeningToQuery.query_results:_query": "Search Results: Found", - "com.alibaba.nacos.page.form.Data_Id_can_not_be_empty": "Data ID cannot be empty", - "com.alibaba.nacos.page.listeningToQuery.group_can_not_be_empty": "Group cannot be empty", - "com.alibaba.nacos.page.pushTrajectory.please_input_Group": "Enter Group", - "com.alibaba.nacos.page.configRollback.rollback_successful": "Rollback Successful", - "com.alibaba.nacos.component.MiddleWareEnv.payTM_daily": "payTM Daily", - "nacos.page.configurationManagement.unprocessed_entry": "Unprocessed Entry:", - "nacos.component.ImportDialog.To_terminate_the_import0": "Terminate", - "nacos.page.configurationManagement.import": "Import", - "com.alibaba.nacos.page.configRollback.configuration_rollback": "Configuration Rollback", - "nacos.page.configurationManagement.HOME_Application": "Application", - "com.alibaba.nacos.layout.noenv.app_configuration_management_acm": "NACOS", - "nacos.page.namespace.SecretKey_recommended2": "SecretKey recommended:", - "newconfig": "Create Configuration", - "nacos.component.validateDialog.fill_the_code": "Please fill out the verification code", - "nacos.page.configurationManagement.ecs_ram_role": "Automatically issued the AccessKey and SecretKey (Recommended for production environment):", - "nacos.component.DeleteDialog.Configuration_management": "Configuration Management", - "com.alibaba.nacos.page.pushTrajectory.The_new_configuration_value_persistent": "Configuration Published", - "nacos.page.newconfig.Description": "Description:", - "nacos.component.ImportDialog.Import_configuration4": "Import ( ", - "com.alibaba.nacos.page.configurationManagement.clickfordetail": "Learn more about ACM SDKs", - "com.alibaba.nacos.page.newconfig.collapse": "Advanced Options", - "com.alibaba.nacos.page.configurationManagement.click_to_learn_Group": "Learn more about Group", - "com.alibaba.nacos.component.NewDatePicker.30_minutes": "30 minutes", - "com.alibaba.nacos.page.namespace.delete": "Delete", - "nacos.page.namespace.ACM_special_SecretKey_will_be_abandoned,_not_recommended_for_use4": "ACM special SecretKey will be abandoned, not recommended for use:", - "dateinfo2": "The time range cannot exceed 45 days", - "com.alibaba.nacos.page.newconfig.publish_failed": "Publish failed. Make sure parameters are entered correctly.", - "com.alibaba.nacos.page.consistencyEfficacy.configuration_consistency_check": "Configuration Consistency Check", - "nacos.page.configurationManagement.configuration_export9": "Export", - "com.alibaba.nacos.page.configsync.sync_configuration_main": "Synchronize Configuration", - "com.alibaba.nacos.page.namespace.public": "public(to retain control)", - "com.alibaba.nacos.page.configeditor.wrong": "Error", - "com.alibaba.nacos.page.configsync.error": "Error", - "nacos.page.configurationManagement.ACM_special_SecretKey_will_be_abandoned,_not_recommended_for": "ACM special SecretKey will be abandoned, not recommended for use:", - "com.alibaba.nacos.page.newconfig.release": "Back", - "com.alibaba.nacos.component.NewDatePicker.4_hours": "4 hours", - "com.alibaba.nacos.page.configeditor.toedit": "Edit Configuration", - "nacos.page.configurationManagement.AccessKey_recommended3": "AccessKey (Recommended for development environment):", - "nacos.page.configurationManagement.items_for": " items are ", - "com.alibaba.nacos.page.pushTrajectory.query_dimension": "Query Dimension:", - "com.alibaba.nacos.page.listeningToQuery.configuration": "Configuration", - "com.alibaba.nacos.page.configsync.retracted": "Collapse", - "com.alibaba.nacos.component.NewDatePicker.12_hours": "12 hours", - "nacos.page.pushTrajectory.Please_enter_the_user_IP0": "Enter IP", - "com.alibaba.nacos.component.MiddleWareEnv.international": "Internationalization", - "com.alibaba.nacos.page.configeditor.the_target_environment:": "Application:", - "day": " days", - "nacos.page.configurationManagement.please_input_the_application_name": "Enter app name", - "nacos.component.ImportDialog.file_upload_directly_after_importing_the_configuration,_please_be_sure_to_exercise_caution7": "Caution: data will be imported directly after uploading.", - "com.alibaba.nacos.page.configurationManagement.delete": "Delete", - "com.alibaba.nacos.component.SuccessDialog.Configuration_management": "Configuration Management", - "com.alibaba.nacos.page.configRollback.updated": "Update", - "com.alibaba.nacos.page.configRollback.determine": "Are you sure you want to roll back", - "nacos.component.DeleteDialog.deleted_successfully_configured": "Configuration deleted", - "nacos.page.configurationManagement.export_check_failed": "Export check failed.", - "com.alibaba.nacos.page.configeditor.configcontent": "Configuration Content", - "nacos.page.namespace.AccessKey_recommended0": "AccessKey recommended:", - "nacos.page.namespace.region_ID": "Region ID:", - "com.alibaba.nacos.component.NewNameSpace.norepeat": "Duplicate namespace. Please enter a different name.", - "com.alibaba.nacos.component.EditorNameSpace.load": "Namespace:", - "com.alibaba.nacos.page.configurationManagement.version": "Historical Versions", - "com.alibaba.nacos.page.namespace.operation": "Actions", - "com.alibaba.nacos.page.newconfig": "Data ID cannot be empty.", - "nacos.component.validateDialog.verification_code_error": "verification code error", - "nacos.page.namespace.remove_the_namespace": "Remove the namespace", - "com.alibaba.nacos.component.MiddleWareEnv.performance": "Performance", - "nacos.page.namespace.note_ACM_is_dedicated_AK/SK_is_mainly_used_for_some_of_the_compatibility_s": "note: ACM is dedicated AK/SK is mainly used for some of the compatibility scenario, it is recommended to Unified the use of Ali cloud AK/SK.", - "nacos.component.ExportDialog.|_The_selected_entry0": "| Selected Entry", - "com.alibaba.nacos.component.EditorNameSpace.confirm_modify": "Edit Namespace", - "com.alibaba.nacos.page.newconfig.do_not_ente": "Illegal characters not allowed", - "nacos.page.newconfig.Data_encryption0": "Data encryption", - "nacos.component.ShowCodeing.,_6000);_System.out.println(content);_//_初始化的时候,给配置添加监听,配置变更会回调通知_ConfigService.addListener(": "\", 6000);\t\t\tSystem.out.println(content);\t\t\t// 初始化的时候,给配置添加监听,配置变更会回调通知\t\t\tConfigService.addListener(\"", - "nacos.page.configurationManagement.Clone_failed": "Clone failed", - "com.alibaba.nacos.page.configdetail.return": "Back", - "com.alibaba.nacos.page.configeditor.stop_beta": "Stop Beta Publishing", - "com.alibaba.nacos.component.NewNameSpace.input": "Illegal characters not allowed", - "nacos.page.configurationManagement.Tags": "Tags:", - "com.alibaba.nacos.page.pushTrajectory.cluster_synchronization": "Synchronization across Clusters ", - "nacos.page.namespace.ecs_ram_role": "Automatically issued the AccessKey and SecretKey (Recommended for production environment):", - "nacos.page.configurationManagement.whether_to_delete_the_selected": "Are you sure to delete the selected", - "nacos.page.configeditor.Tags": "Tags:", - "com.alibaba.nacos.page.newconfig.stop_beta": "Stop Beta Publishing", - "nacos.component.NameSpaceList.Announcement_nodejs_version_is_developed,supports_a_custom_message": "Announcement: Node.js version now available, supporting customized messages.", - "nacos.page.configurationManagement.bulk_delete": "Delete", - "com.alibaba.nacos.page.serviceManagement.service_list": "Service List", - "com.alibaba.nacos.page.serviceManagement.service_name": "Service Name", - "com.alibaba.nacos.page.serviceManagement.please_enter_the_service_name": "Enter Service Name", - "com.alibaba.nacos.page.serviceManagement.table.column.service_name": "Service Name", - "com.alibaba.nacos.page.serviceManagement.table.column.cluster_count": "Cluster Count", - "com.alibaba.nacos.page.serviceManagement.table.column.ip_count": "Instance Count", - "com.alibaba.nacos.page.serviceManagement.table.column.health_status": "Healthy Instance Count", - "com.alibaba.nacos.page.serviceManagement.table.column.operation": "Operation", - "com.alibaba.nacos.page.serviceManagement.detail": "Details", - "com.alibaba.nacos.page.serviceManagement.delete": "Delete", - "com.alibaba.nacos.page.serviceManagement.prompt": "Confirm", - "com.alibaba.nacos.page.serviceManagement.prompt_delete": "Do you want to delete the service?", - "com.alibaba.nacos.page.serviceManagement.create": "Create Service", - "com.alibaba.nacos.page.serviceManagement.query": "Search", - "serviceManagement": "Service Management", - "com.alibaba.nacos.page.serviceDetail.service_details": "Service Details", - "com.alibaba.nacos.page.serviceDetail.create_service": "Create Service", - "com.alibaba.nacos.page.serviceDetail.edit_service": "Edit Service", - "com.alibaba.nacos.page.serviceDetail.back": "Back", - "com.alibaba.nacos.page.serviceDetail.service_name": "Service Name", - "com.alibaba.nacos.page.serviceDetail.protect_threshold": "Protect Threshold", - "com.alibaba.nacos.page.serviceDetail.health_check_pattern": "Health check pattern", - "com.alibaba.nacos.page.serviceDetail.health_check_pattern.service": "Service", - "com.alibaba.nacos.page.serviceDetail.health_check_pattern.client": "Client", - "com.alibaba.nacos.page.serviceDetail.health_check_pattern.none": "None", - "com.alibaba.nacos.page.serviceDetail.metadata": "Metadata", - "com.alibaba.nacos.page.serviceDetail.update_service": "Update Service", - "com.alibaba.nacos.page.serviceDetail.cluster": "Cluster", - "com.alibaba.nacos.page.serviceDetail.edit_cluster": "Edit Cluster", - "com.alibaba.nacos.page.serviceDetail.port": "Port", - "com.alibaba.nacos.page.serviceDetail.weight": "Weight", - "com.alibaba.nacos.page.serviceDetail.healthy": "Healthy", - "com.alibaba.nacos.page.serviceDetail.operation": "Operation", - "com.alibaba.nacos.page.serviceDetail.editor": "Edit", - "com.alibaba.nacos.page.serviceDetail.offline": "Offline", - "com.alibaba.nacos.page.serviceDetail.online": "Online", - "com.alibaba.nacos.page.serviceDetail.check_type": "Check Type", - "com.alibaba.nacos.page.serviceDetail.check_port": "Check Port", - "com.alibaba.nacos.page.serviceDetail.use_ip_port_check": "Use port of IP", - "com.alibaba.nacos.page.serviceDetail.check_path": "Check Path", - "com.alibaba.nacos.page.serviceDetail.check_headers": "Check Headers", - "com.alibaba.nacos.page.serviceDetail.update_cluster": "Update Cluster", - "com.alibaba.nacos.page.serviceDetail.update_instance": "Update Instance", - "com.alibaba.nacos.page.serviceDetail.whether_online": "Whether Online", - "serviceDetail": "Service Details", - "nacos.page.ConfigEditor.submit_failed": "Cannot be empty, submit failed", - } -} + 'en-us': { + 'com.alibaba.nacos.layout.noenv.nacosversion': '0.4.0', + 'com.alibaba.nacos.page.configurationManagementVirtual': 'ConfigManagement', + 'com.alibaba.nacos.page.serviceManagementVirtual': 'ServiceManagement', + 'nacos.component.CloneDialog.the_same_configuration': 'Conflict:', + to: 'to', + 'nacos.page.newconfig.data_encryption3': 'Data Encryption:', + 'nacos.page.configurationManagement.batch_management': 'Batch Operation', + 'com.alibaba.nacos.page.configsync.return': 'Back', + 'com.alibaba.nacos.page.pushTrajectory.getconfig': 'Get Configuration', + cancel: 'Cancel', + 'nacos.component.CloneDialog.Terminate_the_clone0': 'Terminate', + 'com.alibaba.nacos.component.NewNameSpace.newnamespce': 'Create Namespace', + 'com.alibaba.nacos.page.pushTrajectory.Data_Id_can_not_be_empty': 'Data ID cannot be empty', + 'com.alibaba.nacos.component.MiddleWareEnv.maletest': 'male. test', + 'com.alibaba.nacos.page.configeditor.group_is_not_empty': 'Advanced Options', + 'com.alibaba.nacos.component.editorNameSpace': 'Dedicated Space', + 'nacos.component.CloneDialog.target_space': 'Target:', + 'nacos.page.newconfig.off1': 'Off', + 'com.alibaba.nacos.component.NameSpaceList.Announcement_nodejs_version_is_developed,supports_a_c': 'Announcement: Node.js version now available, supporting customized messages.', + 'com.alibaba.nacos.page.pushTrajectory.user_Ip': 'User IP:', + 'nacos.page.configurationManagement.a_ACM_front-end_monitoring_questionnaire,_the_time_limit_to_': 'a ACM front-end monitoring questionnaire, the time limit to receive Ali cloud voucher details shoved stamp: the', + 'nacos.page.configurationManagement.Important_reminder0': 'Important reminder', + 'com.alibaba.nacos.page.pushTrajectory.the_query_results:_a_total_query_to': 'Results: Found', + 'com.alibaba.nacos.page.configdetail.belongs_to_the_environment': 'Region:', + 'com.alibaba.nacos.page.configurationManagement.operation': 'Actions', + 'com.alibaba.nacos.layout.noenv.app_configuration_management_ACM': 'NACOS', + 'nacos.page.namespace.note_ACM_is_dedicated_AK/SK_is_mainly_used_for_some_of_the_compatibility_scenario,_it_is_recommended_to_Unified_the_use_of_Ali_cloud_AK/SK.5': "Note: ACM's dedicated AK/SK is mainly used for improved compatibilities. We recommend that you always use Alibaba Cloud AK/SK.", + 'com.alibaba.nacos.component.ShowCodeing.Sample_code': 'Sample Code', + 'nacos.page.newconfig.Open0': 'Open', + custom: 'Customize', + 'com.alibaba.nacos.page.pushTrajectory.Group_Id_cannot_be_empty': 'Group name cannot be empty', + 'com.alibaba.nacos.page.environmentalManagement.operation': 'operation', + 'com.alibaba.nacos.page.configRollback.environment': 'Region:', + 'com.alibaba.nacos.page.pushTrajectory.please_enter_a_query_Ip': 'Enter IP', + confirm: 'OK', + 'nacos.page.configurationManagement.successful_entry': 'Successful Entry:', + 'com.alibaba.nacos.page.configurationManagement.configuration_query': 'Configuration Search', + 'nacos.page.configurationManagement._Details_of8': ' Details of', + 'com.alibaba.nacos.page.namespace.add': 'Create Namespace', + 'nacos.component.ImportDialog.the_same_configuration6': 'Conflict:', + 'com.alibaba.nacos.page.pushTrajectory.Push_the_trajectory': 'Push Tracks', + configsync: 'Synchronize Configuration', + 'nacos.page.namespace.Namespace_details': 'Namespace details', + dateinfo1: 'The end time must be greater than the start time', + 'com.alibaba.nacos.page.newconfig.group_is_not_empty': 'Group ID cannot exceed 127 characters in length', + 'com.alibaba.nacos.page.configurationManagement.click_to_learn_DataId': 'Learn more about Data ID', + 'com.alibaba.nacos.page.configdetail.configuration_details': 'Configuration Details', + 'com.alibaba.nacos.page.namespace.edit': 'Edit', + 'nacos.page.newconfig.Tags': 'Tags:', + 'nacos.page.configurationManagement.please_choose_the_required_export_configuration_items10': 'Please select configuration items to export.', + 'nacos.page.namespace.namespace_name': 'Name:', + 'com.alibaba.nacos.component.MiddleWareEnv.ungrouped': 'Ungrouped', + 'nacos.component.ImportDialog.target_space5': 'Target:', + 'com.alibaba.nacos.page.pushTrajectory.configok': 'New Configuration Published', + 'com.alibaba.nacos.page.newconfig.esc_exit': 'Publish', + 'nacos.page.namespace.ACM_dedicated_AccessKey_will_the_waste,_does_not_recommend_the_use_of3': 'ACM dedicated AccessKey will the waste, does not recommend the use of:', + 'nacos.page.configurationManagement.ACM_dedicated_AccessKey_will_the_waste,_does_not_recommend_t': 'ACM dedicated AccessKey will the waste, does not recommend the use of:', + 'com.alibaba.nacos.page.newconfig.the_more_advanced': 'Group cannot be empty', + 'nacos.page.configurationManagement.SecretKey_recommended5': 'SecretKey (Recommended for development environment):', + 'nacos.page.configurationManagement.Configuration_cloning0': 'Clone', + 'com.alibaba.nacos.page.pushTrajectory.configuration': 'Configuration', + 'com.alibaba.nacos.page.newconfig.new_listing_main': 'Create Configuration', + 'nacos.page.configurationManagement.Batch_processing0': 'Batch processing', + 'com.alibaba.nacos.page.configeditor.look': 'View Push Track', + 'com.alibaba.nacos.page.configsync.sync_configuration': 'Synchronize Configuration Successfully', + 'com.alibaba.nacos.page.configeditor.official': 'Official', + 'nacos.page.configeditor.Data_encryption0': 'Data encryption', + 'nacos.component.NameSpaceList.Announcement_nodejs_version_is_developed,supports_a_custom_messag': 'Announcement: Node.JS version now available, supporting customized messages.', + 'com.alibaba.nacos.page.historyDetail.update': 'Update', + 'com.alibaba.nacos.page.pushTrajectory.user_IP': 'IP', + 'nacos.component.ImportDialog.Upload_File3': 'Upload File', + 'com.alibaba.nacos.component.NewDatePicker.60_-_': '60 minutes', + 'nacos.page.configurationManagement.note_ACM_is_dedicated_AK/SK_is_mainly_used_for_some_of_the_c': 'note: ACM is dedicated AK/SK is mainly used for some of the compatibility scenario, it is recommended to Unified the use of Ali cloud AK/SK.', + 'com.alibaba.nacos.page.newconfig.Data_ID_length': 'Collapse', + 'nacos.page.configurationManagement.Please_enter_the_name_of_the_app1': 'Enter App Name\n', + 'com.alibaba.nacos.page.configeditor.toedittitle': 'Edit Configuration', + 'nacos.component.CloneDialog.configuration_number': 'Items:', + chaxunfanwei: 'Query Range', + 'com.alibaba.nacos.page.configeditor.beta_release_notes(default_not_checked)': 'Beta Publish:', + 'nacos.page.configurationManagement.open_Bulletin_Board7': 'open Bulletin Board', + 'com.alibaba.nacos.component.SuccessDialog.failure': 'Failed', + 'com.alibaba.nacos.component.ShowCodeing.loading': 'Loading...', + 'com.alibaba.nacos.page.configsync.home': 'Application:', + minute: ' minutes', + 'cspupcloud.page.historyRollback.Retained_for_30_days': 'Retained for 30 days', + 'com.alibaba.nacos.page.configRollback.delete': 'Delete', + 'com.alibaba.nacos.page.configeditor.beta_release:': 'Target Region:', + 'com.alibaba.nacos.page.consistencyEfficacy.environment_name': 'environment name', + 'com.alibaba.nacos.component.SuccessDialog.success': 'Successful', + 'com.alibaba.nacos.page.namespace.configuration': 'Number of Configurations', + hour: ' hours', + 'com.alibaba.nacos.page.configRollback.please_confirm_rollback': 'Roll Back', + 'nacos.page.configurationManagement.ACM_special_SecretKey_will_be_abandoned,_not_recommended_for_use6': "ACM's dedicated SecretKey (To be deprecated soon and not recommended):", + 'nacos.component.ExportDialog.source_space5': 'Source:', + 'com.alibaba.nacos.component.SuccessDialog.determine': 'OK', + 'com.alibaba.nacos.component.EnvConfigTopBar.context_switching': 'Switch Region', + 'nacos.component.DeleteDialog.delete_the_configuration_failed': 'Deleting configuration failed', + 'com.alibaba.nacos.page.configurationManagement.more': 'More', + 'com.alibaba.nacos.page.pushTrajectory.please_enter_the_dataID': 'Enter Data ID', + 'com.alibaba.nacos.page.configRollback.inserted': 'Insert', + 'com.alibaba.nacos.page.configeditor.Home_application:': 'Group name cannot be empty', + 'com.alibaba.nacos.page.configurationManagement.environment': 'Region:', + 'com.alibaba.nacos.component.NewNameSpace.prompt': 'Notice', + 'com.alibaba.nacos.page.configurationManagement.push_track': 'Push Track', + 'hanxie.show': 'test', + 'com.alibaba.nacos.page.configdetail.configuration': 'Configuration Content:', + 'com.alibaba.nacos.pubshow': 'The sub-account is not anthorized. Contact the owner of the primary account to grant permission first.', + 'com.alibaba.nacos.page.newconfig.stop_fails': 'Failed to stop beta publishing.', + 'com.alibaba.nacos.page.newconfig.group_placeholder': 'Enter your group name', + 'nacos.page.namespace._Remove_the_namespace_success': ' Remove the namespace success', + 'com.alibaba.nacos.component.MiddleWareEnv.from-test': 'Self-Test', + 'com.alibaba.nacos.component.EditorNameSpace.public_space': 'OK', + 'com.alibaba.nacos.page.consistencyEfficacy.details': 'Details', + 'com.alibaba.nacos.page.configeditor.vdchart': 'Illegal characters not allowed', + 'nacos.page.configurationManagement.Please_enter_application_name1': 'Enter App Name', + 'com.alibaba.nacos.page.pushTrajectory.query_dimension:': 'Dimension:', + 'nacos.page.namespace.sure_you_want_to_delete_the_following_namespaces?': 'Sure you want to delete the following namespaces?', + 'nacos.component.ImportDialog.cover2': 'Overwrite', + 'com.alibaba.nacos.component.MiddleWareEnv.daily_stable': 'Daily Stable', + 'com.alibaba.nacos.component.EditorNameSpace.edit_namespace': 'Loading...', + 'com.alibaba.nacos.page.newconfig.dataId_is_not_empty': 'Data ID cannot exceed 255 characters in length', + 'com.alibaba.nacos.page.configurationManagement.article_meet_the_requirements': 'configuration items', + 'com.alibaba.nacos.component.NewNameSpace.name': 'Namespace:', + 'com.alibaba.nacos.page.configeditor.more_advanced_options': 'Collapse', + 'com.alibaba.nacos.page.historyRollback.details': 'Details', + 'nacos.page.newconfig._to_go_to_the_opening_of1': ' to go to the opening of', + 'nacos.page.configurationManagement.please_select_the_required_delete_the_configuration_item': 'Select configuration items to delete', + 'nacos.component.DeleteDialog.deletetitle': 'Delete Configuration', + 'com.alibaba.nacos.page.configeditor.recipient_from': 'Data ID cannot be empty', + 'nacos.page.namespace.namespace_ID': 'ID:', + 'com.alibaba.nacos.component.MiddleWareEnv.Spas_dedicated': 'Spas Dedicated', + historyRollback: 'Historical Versions', + 'com.alibaba.nacos.page.newconfig.full_screen': 'Press Esc to exit', + 'com.alibaba.nacos.page.listAllEnvironmental.environment_marked': 'environment marked', + 'nacos.page.namespace.delete_failed': 'Failed to Delete', + 'com.alibaba.nacos.page.configsync.configuration': 'Configuration Content:', + configeditor: 'Edit Configuration', + 'com.alibaba.nacos.component.NameSpaceList.immediate_use': 'Try Now', + 'com.alibaba.nacos.page.configRollback.rollback': 'Roll Back', + 'com.alibaba.nacos.page.configeditor.configuration_format:': 'Deselected by default. Learn more about beta publishing.\n', + 'com.alibaba.nacos.page.listAllEnvironmental.environment_name': 'environment name,', + 'com.alibaba.nacos.page.configeditor.': 'Back', + 'nacos.component.validateDialog.Click_to_get_verification_code': 'Click to Get Verification Code', + configRollback: 'Configuration Rollback', + 'com.alibaba.nacos.component.NameSpaceList.Announcement_nodejs_version_is_developed,supports_a_custom_message': 'Announcement: Node.js version now available, supporting customized messages.', + 'nacos.page.configurationManagement.advanced_query9': 'Advanced Query', + 'com.alibaba.nacos.page.configdetail.official': 'Official', + 'nacos.page.configurationManagement.process_is_successful,_the_cloned': 'Process successfully, cloned ', + 'nacos.component.ShowCodeing.,_new_PropertiesListener()_{_@Override_public_void_innerReceive(Pro': '", new PropertiesListener() {\t\t\t\t\t\t\t\t@Override\t\t\t\tpublic void innerReceive(Properties properties) {\t\t\t\t\t// TODO Auto-generated method stub\t\t\t\t\tacmProperties = properties;\t\t\t\t\tSystem.out.println(properties);\t\t\t\t}\t\t\t});\t\t\t\t\t\t**/\t\t\t\t\t} catch (ConfigException e) {\t\t\te.printStackTrace();\t\t}\t\t// 测试让主线程不退出,因为订阅配置是守护线程,主线程退出守护线程就会退出。 正式代码中无需下面代码\t\twhile (true) {\t\t\ttry {\t\t\t\tThread.sleep(1000);\t\t\t} catch (InterruptedException e) {\t\t\t\te.printStackTrace();\t\t\t}\t\t}\t}\t // 通过get接口把配置值暴露出去使用 public static String getConfig() { return config; } \t// 通过get接口把配置值暴露出去使用\tpublic static Object getPorpertiesValue(String key) {\t\tif (acmProperties != null) {\t\t\treturn acmProperties.get(key);\t\t}\t\treturn null;\t}}', + 'com.alibaba.nacos.page.listeningToQuery.query_dimension': 'Dimension:', + 'nacos.component.DeleteDialog.determine': 'OK', + 'com.alibaba.nacos.page.configurationManagement.details': 'Details', + pubnodata: 'No results found.', + configdetail: 'Configuration Details', + 'com.alibaba.nacos.page.configurationManagement.edit': 'Edit', + 'com.alibaba.nacos.page.listAllEnvironmental.view_environment_IP': 'View environment IP', + 'com.alibaba.nacos.page.historyDetail.home': 'Application:', + 'com.alibaba.nacos.page.configeditor.configuration_formatpre': 'Deselected by default. ', + 'com.alibaba.nacos.component.AddGroup.prompt': 'Notice', + 'com.alibaba.nacos.page.consistencyEfficacy.configuration_content_md5': 'Configuration Content MD5', + 'com.alibaba.nacos.component.NameSpaceList.online_customer_support': 'Online Customer Support:', + 'nacos.page.configurationManagement.Delete_failed': 'Delete failed', + 'com.alibaba.nacos.page.consistencyEfficacy.edit': 'Edit', + 'nacos.component.ExportDialog.HOME_Application1': 'Application:', + 'com.alibaba.nacos.page.configurationManagement.fuzzyd': 'Enter Data ID', + 'com.alibaba.nacos.page.listeningToQuery.query': 'Search', + 'com.alibaba.nacos.component.MiddleWareEnv.daily_environment_packet': 'Daily Environment Group', + 'com.alibaba.nacos.component.NewDatePicker.to': 'Search Range:', + 'nacos.component.ExportDialog.export3': 'Export', + 'com.alibaba.nacos.layout.noenv.Click_to_learn_the_namespace': 'Learn more about namespace', + 'com.alibaba.nacos.page.pushTrajectory.determine': 'Search', + 'com.alibaba.nacos.page.historyRollback.dataid': 'Enter Data ID', + 'nacos.page.namespace.SecretKey_recommended3': 'SecretKey (Recommended for development environment):', + 'com.alibaba.nacos.page.historyDetail.insert': 'Insert', + 'com.alibaba.nacos.component.MiddleWareEnv.daily_units': 'Daily Units', + 'nacos.component.validateDialog.confirm': 'confirm', + 'com.alibaba.nacos.component.EditorNameSpace.please_do': 'Illegal characters not allowed', + 'nacos.page.configurationManagement.view_details1': 'view details', + 'com.alibaba.nacos.component.NewDatePicker.to_cancel_the': 'OK', + 'nacos.component.validateDialog.phoneNumber': 'Mobile phone number:', + 'com.alibaba.nacos.page.newconfig.Group_ID_cannot_be_longer': 'Application:', + 'nacos.page.newconfig.The_opening_of_the_data_encryption-related_services0': 'The Opening of the Data Encryption-Related Services', + 'com.alibaba.nacos.component.MiddleWareEnv.cloud_unit': 'Cloud Unit', + 'com.alibaba.nacos.component.NewDatePicker.recently': 'Cancel', + 'nacos.page.namespace.Namespace': 'Namespaces', + 'com.alibaba.nacos.page.listAllEnvironmental.operation': 'operation', + 'nacos.page.configurationManagement.select_need_to_clone_the_configuration_items1': 'Please select configuration items to clone.', + 'nacos.page.configurationManagement.ACM_dedicated_AccessKey_will_the_waste,_does_not_recommend_the_use_of5': "ACM's dedicated AccessKey (To be deprecated soon and not recommended):", + 'nacos.component.CloneDialog.tags': 'tags:', + 'com.alibaba.nacos.component.NewNameSpace.confirm': 'OK', + 'com.alibaba.nacos.page.configRollback.home': 'Application:', + 'nacos.page.configurationManagement.a_ACM_front-end_monitoring_questionnaire,_the_time_limit_to_receive_Ali_cloud_voucher_details_shoved_stamp_the3': 'a ACM front-end monitoring questionnaire, the time limit to receive Ali cloud voucher details shoved stamp: the', + 'com.alibaba.nacos.page.configeditor.Esc_exit': 'Press F1 to view in full screen', + 'nacos.page.configurationManagement.click_on_the_obtain_of3': 'Click on the obtain of', + 'com.alibaba.nacos.page.listAllEnvironmental.view': 'View', + 'nacos.page.configeditor.Description': 'Description:', + 'com.alibaba.nacos.page.historyDetail.belongs_to_the_environment': 'Region:', + 'nacos.page.configurationManagement.off_the_Bulletin_Board5': 'off the Bulletin Board', + 'com.alibaba.nacos.page.configeditor.release_beta': 'Press Esc to exit ', + 'com.alibaba.nacos.page.configurationManagement.Remove_configuration': 'Delete Configuration', + 'nacos.page.namespace.deleted_successfully': 'Deleted successfully', + 'nacos.component.CloneDialog.configuration_cloning(': 'Clone(', + 'com.alibaba.nacos.page.configRollback.configuration': 'Configuration Content:', + 'com.alibaba.nacos.component.DiffEditorDialog.original_value': 'Original Value', + 'com.alibaba.nacos.page.historyDetail.return': 'Back', + 'com.alibaba.nacos.page.configeditor.configure_contents_of': 'Format:', + 'com.alibaba.nacos.page.listeningToQuery.article_meet_the_requirements_of_the_configuration.': 'configuration items.', + 'com.alibaba.nacos.page.configurationManagement.query': 'Search', + 'com.alibaba.nacos.page.historyRollback.last_update_time': 'Last Modified At', + 'nacos.component.CloneDialog.source_space': 'Source :', + 'nacos.component.ShowCodeing.);_/**_*_生产环境通过jvm参数传参,以便使用多个环境,_-Dacm.endpoint=': '");\t\t\t\t\t\t/**\t\t\t * 生产环境通过JVM参数传参,以便使用多个环境, -Dacm.endpoint=', + 'com.alibaba.nacos.layout.noenv.does_not_exist': 'The page you visit does not exist', + 'com.alibaba.nacos.page.historyDetail.configure_content': 'Configuration Content:', + 'nacos.component.ShowCodeing.*///_ConfigService.init();_//_主动获取配置_String_content_=_ConfigService.getConfig(': '*///\t\t\tConfigService.init();\t\t\t\t\t\t// 主动获取配置\t\t\tString content = ConfigService.getConfig("', + 'com.alibaba.nacos.page.configurationManagement.query_results': 'Search Results: Found', + 'nacos.component.ShowCodeing.,_new_ConfigChangeListener()_{_public_void_receiveConfigInfo(String': '", new ConfigChangeListener() {\t\t\t\tpublic void receiveConfigInfo(String configInfo) {\t\t\t\t\t// 当配置更新后,通过该回调函数将最新值吐给用户。\t\t\t\t\t// 注意回调函数中不要做阻塞操作,否则阻塞通知线程。\t\t\t\t\tconfig = configInfo;\t\t\t\t\tSystem.out.println(configInfo);\t\t\t\t}\t\t\t});\t\t\t\t\t\t/**\t\t\t * 如果配置值的內容为properties格式(key=value), 可使用下面监听器。以便一个配置管理多个配置项\t\t\t */\t\t\t\t\t\t/**\t\t\tConfigService.addListener("', + 'com.alibaba.nacos.page.consistencyEfficacy.advanced_query': 'Advanced Query', + 'com.alibaba.nacos.page.historyDetail.delete': 'Delete', + 'nacos.component.NameSpaceList.Forum': 'Forum', + 'com.alibaba.nacos.page.namespace.prompt': 'Notice', + 'com.alibaba.nacos.page.configdetail.more_advanced_options': 'Advanced Options', + 'com.alibaba.nacos.page.listeningToQuery.listener_query': 'Listening Query', + 'com.alibaba.nacos.page.newconfig.the_home_application': 'Target Region:', + 'nacos.page.namespace.click_on_the_obtain_of1': 'Click on the obtain of', + 'nacos.component.NameSpaceList.Quick_to_learn0': 'Learning Path', + 'nacos.component.CloneDialog.get_the_namespace_failed': 'get the namespace failed', + 'com.alibaba.nacos.component.EditorNameSpace.namespace': 'Namespace cannot be empty', + 'nacos.component.validateDialog.remark': 'Tip: The verification code will be sent through SMS to your bound phone number.', + 'com.alibaba.nacos.page.consistencyEfficacy.query': 'Query', + 'com.alibaba.nacos.page.environmentalManagement.environment_name': 'environment name,', + 'com.alibaba.nacos.page.listAllEnvironmental.environment_IP': 'environment IP', + 'com.alibaba.nacos.page.listeningToQuery.success': 'Success', + 'nacos.component.CloneDialog.|_the_selected_entry': '| Selected entry', + 'com.alibaba.nacos.component.MiddleWareEnv.offline': 'Offline', + 'com.alibaba.nacos.page.listeningToQuery.please_input_ip': 'Enter IP', + 'com.alibaba.nacos.page.historyDetail.recipient_from': 'Collapse', + 'com.alibaba.nacos.page.newconfig.configuration_format': 'Configuration Content', + 'com.alibaba.nacos.component.NewDatePicker.query_range:': 'Customize', + 'nacos.component.CloneDialog.skip': 'Skip', + 'com.alibaba.nacos.page.listeningToQuery.please_enter_the_dataid': 'Enter Data ID', + 'com.alibaba.nacos.component.NewDatePicker.7_day': '7 days', + 'nacos.component.ShowCodeing.-Dproject.name=acmtest_-Dspas.identity=CUserswater.lyl.spas_keyacmt': '-Dproject.name=acmtest -Dspas.identity=C:Userswater.lyl.spas_keyacmtest\t\t\t * 在本地的acmtest文件中填写accessKey/secretKey,格式如下\t\t\t * accessKey=', + 'com.alibaba.nacos.service.fill_the_code': 'Please fill out the verification code', + 'com.alibaba.nacos.page.historyDetail.more_advanced_options': 'Advanced Options', + 'com.alibaba.nacos.page.newconfig.configure_contents_of': 'Press F1 to view in full screen', + 'nacos.component.ImportDialog.file_upload_directly_after_importing_the_configuration,_please_be_': 'Caution: Data will be imported directly after uploading.', + 'com.alibaba.nacos.page.newconfig.configuration_contentmax': 'Configuration content cannot exceed 10240 characters in length', + 'com.alibaba.nacos.page.listAllEnvironmental.all_available_environment': 'all available environment', + 'nacos.page.configurationManagement.configuration_management8': 'configuration management', + 'com.alibaba.nacos.component.NewDatePicker.': 'Last', + 'nacos.page.configurationManagement.configuration': ' configuration', + 'nacos.page.configurationManagement._The_process_is_successful,_delete_the': 'Process successfully, delete ', + 'com.alibaba.nacos.page.configsync.target': 'Target Region:', + 'com.alibaba.nacos.page.newconfig.new_listing': 'Create Configuration', + Configdetail: 'Configuration Details', + 'nacos.page.configdetail.Tags': 'Tags:', + listeningToQuery: 'Listening Query', + 'nacos.page.configurationManagement.,_wherein': ', wherein ', + 'com.alibaba.nacos.page.configRollback.retracted': 'Collapse', + 'nacos.component.validateDialog.title': 'Account Security Verification', + 'com.alibaba.nacos.page.configsync.belongs_to_the_environment': 'Region:', + 'com.alibaba.nacos.page.configeditor.return': 'Publish', + 'com.alibaba.nacos.page.historyRollback.queryresult': 'Search Results: Found', + 'com.alibaba.nacos.page.configurationManagement.the_sample_code': 'Code Example', + 'nacos.page.configurationManagement.Cloning_check_fails': 'Cloning check fails', + 'nacos.page.configurationManagement.process_is_successful,_import_the': 'Process successfully, import ', + 'com.alibaba.nacos.page.consistencyEfficacy.environment_marked': 'environment marked', + 'com.alibaba.nacos.page.namespace.namespace_names': 'Namespaces ', + 'nacos.page.namespace.details': 'Details', + 'com.alibaba.nacos.page.configdetail.error': 'Error', + 'com.alibaba.nacos.component.AddGroup.a_new_group': 'Create Group', + 'com.alibaba.nacos.component.DiffEditorDialog.contents': 'Content Comparison', + 'com.alibaba.nacos.page.configRollback.return': 'Back', + 'com.alibaba.nacos.page.configurationManagement.configuration_management': 'Configurations', + 'nacos.page.configurationManagement.import_failed': 'Import Failed', + 'com.alibaba.nacos.page.consistencyEfficacy.operation': 'Actions', + 'nacos.component.ExportDialog.configuration_number6': 'Items:', + 'com.alibaba.nacos.page.pushTrajectory.getconifg': 'Configuration Push or Get Configuration', + 'com.alibaba.nacos.page.environmentalManagement.view_environment_IP': 'View environment IP', + historyDetail: 'History Details', + 'com.alibaba.nacos.component.EditorNameSpace.private': 'Public Space', + 'com.alibaba.nacos.page.configdetail.beta_release': 'Beta Publish:', + 'com.alibaba.nacos.page.historyRollback.group': 'Enter Group', + 'com.alibaba.nacos.component.NameSpaceList.Prompt': 'Notice', + 'com.alibaba.nacos.page.pushTrajectory.the_query_results': 'Search Results: Found', + 'com.alibaba.nacos.page.pushTrajectory.used': 'New Configuration Published', + 'nacos.page.namespace._Details_of6': ' Details of', + 'nacos.page.namespace.namespace_number': 'Namespace ID', + 'com.alibaba.nacos.page.historyrollback.query': 'Search', + 'nacos.component.ExportDialog.tags2': 'Tags:', + 'nacos.page.configurationManagement.Please_enter_tag': 'Enter Tag', + 'nacos.component.ImportDialog.You_can_only_upload._zip_file_format0': 'Only upload. zip file format', + 'nacos.component.CloneDialog.|_the_selected_entry4': '| Selected Entry', + 'com.alibaba.nacos.page.pushTrajectory.track': 'push tracks.', + 'nacos.page.configurationManagement.HOME_Application0': 'Application:', + 'com.alibaba.nacos.component.NewDatePicker.24_hours': '24 hours', + 'com.alibaba.nacos.component.DiffEditorDialog.confirm_that_the': 'Publish', + 'com.alibaba.nacos.component.EditorNameSpace.prompt': 'Notice', + 'nacos.page.namespace.AccessKey_recommended1': 'AccessKey (Recommended for development environment):', + 'com.alibaba.nacos.page.configsync.sync': 'Synchronize', + 'com.alibaba.nacos.page.historyRollback.to_configure': 'Historical Versions (Configuration record is retained for 30 days.)', + 'com.alibaba.nacos.page.pushTrajectory.interval': 'Time Range:', + 'com.alibaba.nacos.component.MiddleWareEnv.daily': 'Daily', + pushTrajectory: 'Push Tracks', + 'com.alibaba.nacos.component.MiddleWareEnv.switch_environment': 'Switch Environment', + 'com.alibaba.nacos.component.NewDatePicker.determine': 'to', + 'nacos.page.configdetail.Open0': 'Open', + 'com.alibaba.nacos.page.historyRollback.article_meet': 'configuration items.', + 'com.alibaba.nacos.page.configeditor.release': 'Beta Publish', + 'nacos.page.newconfig.to_the_authorization_of2': 'to the authorization of', + 'com.alibaba.nacos.component.NewNameSpace.namespacenotnull': 'Namespace cannot be empty', + 'nacos.page.newconfig.Note_You_are_to_be_a_custom_packet_the_new_configuration,_make_sure_that_the_client_use_the_Pandora_version_higher_than_3._4._0,_otherwise_it_may_read_less_than_the_configuration.0': 'Notice: You are going to add configuration to a new group, please make sure that the version of Pandora which clients are using is higher than 3.4.0, otherwise this configuration may be unreadable to clients.', + 'com.alibaba.nacos.page.configRollback.action_type': 'Action Type:', + 'nacos.page.configurationManagement.SecretKey_recommended4': 'SecretKey recommended:', + 'nacos.component.validateDialog.cancel': 'cancel', + 'com.alibaba.nacos.component.AddGroup.group_name': 'Group name:', + 'nacos.page.configurationManagement.no_longer_display4': 'no longer display:', + 'com.alibaba.nacos.component.DiffEditorDialog.of_the_current_area': 'Current Value', + 'com.alibaba.nacos.page.configRollback.belongs_to': 'Region:', + 'com.alibaba.nacos.page.configeditor.F1/fn F1(MAC)full_screen': 'Configuration Content', + recent: 'Last ', + configurationManagement: 'Configurations', + 'com.alibaba.nacos.page.historyRollback.operation': 'Actions', + 'com.alibaba.nacos.page.historyDetail.action_type': 'Action Type:', + 'com.alibaba.nacos.component.MiddleWareEnv.online': 'Online', + 'nacos.page.configurationManagement.configuration_item?': 'configuration items?', + 'com.alibaba.nacos.page.pushTrajectory.configget': 'Get Configuration', + 'com.alibaba.nacos.page.listeningToQuery._Push_state': 'Push Status', + 'com.alibaba.nacos.page.listAllEnvironmental.Into_the': 'Into the', + 'com.alibaba.nacos.page.pushTrajectory.user_Ip:': 'User IP:', + 'nacos.component.CloneDialog.start_cloning': 'Start Clone', + 'com.alibaba.nacos.page.configurationManagement.new_listing': 'Create Configuration', + 'com.alibaba.nacos.component.MiddleWareEnv.online_center': 'Online Center', + 'nacos.component.ShowCodeing.-Dproject.name=acmtest_-Dspas.identity=CUserswater.lyl.spas_keyacmtest_*_在本地的acmtest文件中填写accessKey/secretKey,格式如下_*_accessKey=': '-Dproject.name=acmtest -Dspas.identity=C:Userswater.lyl.spas_keyacmtest\t\t\t * 在本地的acmtest文件中填写accessKey/secretKey,格式如下\t\t\t * accessKey=', + 'com.alibaba.nacos.page.configRollback.for_more_advanced': 'Advanced Options', + 'com.alibaba.nacos.page.configurationManagement.last_modified_time': 'Last Modified At', + namespace: 'Namespaces', + 'nacos.page.configdetail.Data_encryption0': 'Data encryption', + 'com.alibaba.nacos.component.NewDatePicker.3_day': '3 days', + 'nacos.component.ShowCodeing.package_com.alibaba.middleware.acm;import_java.util.Properties;impo': 'package com.alibaba.middleware.acm;import java.util.Properties;import com.alibaba.edas.acm.ConfigService;import com.alibaba.edas.acm.exception.ConfigException;import com.alibaba.edas.acm.listener.ConfigChangeListener;import com.alibaba.edas.acm.listener.PropertiesListener;// 示例代码,仅用于示例测试public class ACMTest { // 属性/开关 private static String config = "DefaultValue";\t private static Properties acmProperties = new Properties(); \tpublic static void main(String[] args) {\t\ttry {\t\t\t\t\t\t// 本地调试模式。本机测试无法连接ACM服务集群,因此设置debug模式(该模式下获取值为null,不会进入回调函数)。\t\t\t// ConfigService.setDebug(true);\t\t\t\t\t\t// 初始化配置服务,控制台通过示例代码自动获取下面参数\t\t\tConfigService.init("', + 'com.alibaba.nacos.page.consistencyEfficacy.query_results': 'Search Results', + 'com.alibaba.nacos.page.environmentalManagement.environment_marked': 'environment marked', + 'com.alibaba.nacos.page.listeningToQuery.failure': 'Failure', + 'com.alibaba.nacos.page.environmentalManagement.view': 'View', + 'com.alibaba.nacos.page.configdetail.home': 'Application:', + 'com.alibaba.nacos.page.pushTrajectory.please_enter': 'Enter IP', + 'com.alibaba.nacos.page.historyRollback.rollback': 'Roll Back', + 'nacos.page.configurationManagement.note_ACM_is_dedicated_AK/SK_is_mainly_used_for_some_of_the_compatibility_scenario,_it_is_recommended_to_Unified_the_use_of_Ali_cloud_AK/SK.7': "Note: ACM's dedicated AK/SK is mainly used for improved compatibilities. We recommend that you always use Alibaba Cloud AK/SK.", + 'com.alibaba.nacos.page.consistencyEfficacy.reset': 'Reset', + 'nacos.component.ExportDialog.export_configuration4': 'Export ( ', + 'com.alibaba.nacos.page.environmentalManagement.environment_ip': 'environment IP', + 'com.alibaba.nacos.component.MiddleWareEnv.new_diamond': 'Diamond(New Version)', + 'com.alibaba.nacos.page.environmentalManagement.Into_the': 'Into the', + 'com.alibaba.nacos.page.configdetail.recipient_from': 'Collapse', + 'com.alibaba.nacos.page.configurationManagement.listener_query': 'Configuration Listening Query', + 'com.alibaba.nacos.page.configurationManagement.suredelete': 'Are you sure you want to delete the following configuration?', + 'nacos.component.CloneDialog.cover': 'Cover', + 'nacos.page.configdetail.Description': 'Description:', + 'com.alibaba.nacos.component.NewDatePicker.end_time_must_be_greater_than_the_start_time_of_the_t': 'The end time must be after the starttime', + 'nacos.component.ShowCodeing.*///_ConfigService.init();_//_主动获取配置_String_content_=_ConfigService': '*///\t\t\tConfigService.init();\t\t\t\t\t\t// 主动获取配置\t\t\tString content = ConfigService.getConfig("', + 'com.alibaba.nacos.page.environmentalManagement.all_available_environment': 'all available environment', + 'nacos.page.configurationManagement.no_announcement6': 'no announcement', + 'com.alibaba.nacos.page.listeningToQuery.please_input_group': 'Enter Group', + 'com.alibaba.nacos.page.configsync.for_more_advanced_options': 'Advanced Options', + 'com.alibaba.nacos.page.historyDetail.history_details': 'History Details', + 'com.alibaba.nacos.component.NewDatePicker.custom': 'The time range cannot exceed 45 days', + 'nacos.component.ShowCodeing.,_6000);_System.out.println(content);_//_初始化的时候,给配置添加监听,配置变更会回调通知_C': '", 6000);\t\t\tSystem.out.println(content);\t\t\t// 初始化的时候,给配置添加监听,配置变更会回调通知\t\t\tConfigService.addListener("', + 'nacos.component.validateDialog.Please_fill_out_the_verification_code': 'Enter the verification code:', + 'com.alibaba.nacos.page.newconfig.the_target_environment': 'Format:', + 'nacos.page.configurationManagement.questionnaire2': 'questionnaire', + 'nacos.page.configdetail.off1': 'off', + 'nacos.page.configurationManagement.clone': 'Clone', + 'com.alibaba.nacos.component.MiddleWareEnv.daily_test_center': 'Daily Test Center', + 'com.alibaba.nacos.page.configRollback.the_following_configuration': 'the following configuration?', + 'nacos.page.configurationManagement.failed_entry': 'Failed Entry:', + 'com.alibaba.nacos.component.NewNameSpace.cancel': 'Cancel', + 'nacos.component.CloneDialog.select_namespace': 'Select Namespace', + 'nacos.page.configurationManagement.export': 'Export', + 'nacos.page.configurationManagement.AccessKey_recommended2': 'AccessKey recommended:', + 'com.alibaba.nacos.component.MiddleWareEnv.line': 'Online/', + 'com.alibaba.nacos.component.NewNameSpace.loading': 'Loading...', + 'nacos.page.newconfig.Note_You_are_to_be_a_custom_packet_the_new_configuration,_make_sure_that_t': 'Note: You are to be a custom packet the new configuration, make sure that the client use the Pandora version higher than 3. 4. 0, otherwise it may read less than the configuration.', + 'com.alibaba.nacos.page.configurationManagement.fuzzyg': 'Enter Group', + 'com.alibaba.nacos.page.pushTrajectory.interval:': 'Time Range:', + 'nacos.component.ImportDialog.skip1': 'Skip', + 'com.alibaba.nacos.page.listeningToQuery.query_results:_query': 'Search Results: Found', + 'com.alibaba.nacos.page.form.Data_Id_can_not_be_empty': 'Data ID cannot be empty', + 'com.alibaba.nacos.page.listeningToQuery.group_can_not_be_empty': 'Group cannot be empty', + 'com.alibaba.nacos.page.pushTrajectory.please_input_Group': 'Enter Group', + 'com.alibaba.nacos.page.configRollback.rollback_successful': 'Rollback Successful', + 'com.alibaba.nacos.component.MiddleWareEnv.payTM_daily': 'payTM Daily', + 'nacos.page.configurationManagement.unprocessed_entry': 'Unprocessed Entry:', + 'nacos.component.ImportDialog.To_terminate_the_import0': 'Terminate', + 'nacos.page.configurationManagement.import': 'Import', + 'com.alibaba.nacos.page.configRollback.configuration_rollback': 'Configuration Rollback', + 'nacos.page.configurationManagement.HOME_Application': 'Application', + 'com.alibaba.nacos.layout.noenv.app_configuration_management_acm': 'NACOS', + 'nacos.page.namespace.SecretKey_recommended2': 'SecretKey recommended:', + newconfig: 'Create Configuration', + 'nacos.component.validateDialog.fill_the_code': 'Please fill out the verification code', + 'nacos.page.configurationManagement.ecs_ram_role': 'Automatically issued the AccessKey and SecretKey (Recommended for production environment):', + 'nacos.component.DeleteDialog.Configuration_management': 'Configuration Management', + 'com.alibaba.nacos.page.pushTrajectory.The_new_configuration_value_persistent': 'Configuration Published', + 'nacos.page.newconfig.Description': 'Description:', + 'nacos.component.ImportDialog.Import_configuration4': 'Import ( ', + 'com.alibaba.nacos.page.configurationManagement.clickfordetail': 'Learn more about ACM SDKs', + 'com.alibaba.nacos.page.newconfig.collapse': 'Advanced Options', + 'com.alibaba.nacos.page.configurationManagement.click_to_learn_Group': 'Learn more about Group', + 'com.alibaba.nacos.component.NewDatePicker.30_minutes': '30 minutes', + 'com.alibaba.nacos.page.namespace.delete': 'Delete', + 'nacos.page.namespace.ACM_special_SecretKey_will_be_abandoned,_not_recommended_for_use4': 'ACM special SecretKey will be abandoned, not recommended for use:', + dateinfo2: 'The time range cannot exceed 45 days', + 'com.alibaba.nacos.page.newconfig.publish_failed': 'Publish failed. Make sure parameters are entered correctly.', + 'com.alibaba.nacos.page.consistencyEfficacy.configuration_consistency_check': 'Configuration Consistency Check', + 'nacos.page.configurationManagement.configuration_export9': 'Export', + 'com.alibaba.nacos.page.configsync.sync_configuration_main': 'Synchronize Configuration', + 'com.alibaba.nacos.page.namespace.public': 'public(to retain control)', + 'com.alibaba.nacos.page.configeditor.wrong': 'Error', + 'com.alibaba.nacos.page.configsync.error': 'Error', + 'nacos.page.configurationManagement.ACM_special_SecretKey_will_be_abandoned,_not_recommended_for': 'ACM special SecretKey will be abandoned, not recommended for use:', + 'com.alibaba.nacos.page.newconfig.release': 'Back', + 'com.alibaba.nacos.component.NewDatePicker.4_hours': '4 hours', + 'com.alibaba.nacos.page.configeditor.toedit': 'Edit Configuration', + 'nacos.page.configurationManagement.AccessKey_recommended3': 'AccessKey (Recommended for development environment):', + 'nacos.page.configurationManagement.items_for': ' items are ', + 'com.alibaba.nacos.page.pushTrajectory.query_dimension': 'Query Dimension:', + 'com.alibaba.nacos.page.listeningToQuery.configuration': 'Configuration', + 'com.alibaba.nacos.page.configsync.retracted': 'Collapse', + 'com.alibaba.nacos.component.NewDatePicker.12_hours': '12 hours', + 'nacos.page.pushTrajectory.Please_enter_the_user_IP0': 'Enter IP', + 'com.alibaba.nacos.component.MiddleWareEnv.international': 'Internationalization', + 'com.alibaba.nacos.page.configeditor.the_target_environment:': 'Application:', + day: ' days', + 'nacos.page.configurationManagement.please_input_the_application_name': 'Enter app name', + 'nacos.component.ImportDialog.file_upload_directly_after_importing_the_configuration,_please_be_sure_to_exercise_caution7': 'Caution: data will be imported directly after uploading.', + 'com.alibaba.nacos.page.configurationManagement.delete': 'Delete', + 'com.alibaba.nacos.component.SuccessDialog.Configuration_management': 'Configuration Management', + 'com.alibaba.nacos.page.configRollback.updated': 'Update', + 'com.alibaba.nacos.page.configRollback.determine': 'Are you sure you want to roll back', + 'nacos.component.DeleteDialog.deleted_successfully_configured': 'Configuration deleted', + 'nacos.page.configurationManagement.export_check_failed': 'Export check failed.', + 'com.alibaba.nacos.page.configeditor.configcontent': 'Configuration Content', + 'nacos.page.namespace.AccessKey_recommended0': 'AccessKey recommended:', + 'nacos.page.namespace.region_ID': 'Region ID:', + 'com.alibaba.nacos.component.NewNameSpace.norepeat': 'Duplicate namespace. Please enter a different name.', + 'com.alibaba.nacos.component.EditorNameSpace.load': 'Namespace:', + 'com.alibaba.nacos.page.configurationManagement.version': 'Historical Versions', + 'com.alibaba.nacos.page.namespace.operation': 'Actions', + 'com.alibaba.nacos.page.newconfig': 'Data ID cannot be empty.', + 'nacos.component.validateDialog.verification_code_error': 'verification code error', + 'nacos.page.namespace.remove_the_namespace': 'Remove the namespace', + 'com.alibaba.nacos.component.MiddleWareEnv.performance': 'Performance', + 'nacos.page.namespace.note_ACM_is_dedicated_AK/SK_is_mainly_used_for_some_of_the_compatibility_s': 'note: ACM is dedicated AK/SK is mainly used for some of the compatibility scenario, it is recommended to Unified the use of Ali cloud AK/SK.', + 'nacos.component.ExportDialog.|_The_selected_entry0': '| Selected Entry', + 'com.alibaba.nacos.component.EditorNameSpace.confirm_modify': 'Edit Namespace', + 'com.alibaba.nacos.page.newconfig.do_not_ente': 'Illegal characters not allowed', + 'nacos.page.newconfig.Data_encryption0': 'Data encryption', + 'nacos.component.ShowCodeing.,_6000);_System.out.println(content);_//_初始化的时候,给配置添加监听,配置变更会回调通知_ConfigService.addListener(': '", 6000);\t\t\tSystem.out.println(content);\t\t\t// 初始化的时候,给配置添加监听,配置变更会回调通知\t\t\tConfigService.addListener("', + 'nacos.page.configurationManagement.Clone_failed': 'Clone failed', + 'com.alibaba.nacos.page.configdetail.return': 'Back', + 'com.alibaba.nacos.page.configeditor.stop_beta': 'Stop Beta Publishing', + 'com.alibaba.nacos.component.NewNameSpace.input': 'Illegal characters not allowed', + 'nacos.page.configurationManagement.Tags': 'Tags:', + 'com.alibaba.nacos.page.pushTrajectory.cluster_synchronization': 'Synchronization across Clusters ', + 'nacos.page.namespace.ecs_ram_role': 'Automatically issued the AccessKey and SecretKey (Recommended for production environment):', + 'nacos.page.configurationManagement.whether_to_delete_the_selected': 'Are you sure to delete the selected', + 'nacos.page.configeditor.Tags': 'Tags:', + 'com.alibaba.nacos.page.newconfig.stop_beta': 'Stop Beta Publishing', + 'nacos.component.NameSpaceList.Announcement_nodejs_version_is_developed,supports_a_custom_message': 'Announcement: Node.js version now available, supporting customized messages.', + 'nacos.page.configurationManagement.bulk_delete': 'Delete', + 'com.alibaba.nacos.page.serviceManagement.service_list': 'Service List', + 'com.alibaba.nacos.page.serviceManagement.service_name': 'Service Name', + 'com.alibaba.nacos.page.serviceManagement.please_enter_the_service_name': 'Enter Service Name', + 'com.alibaba.nacos.page.serviceManagement.table.column.service_name': 'Service Name', + 'com.alibaba.nacos.page.serviceManagement.table.column.cluster_count': 'Cluster Count', + 'com.alibaba.nacos.page.serviceManagement.table.column.ip_count': 'Instance Count', + 'com.alibaba.nacos.page.serviceManagement.table.column.health_status': 'Healthy Instance Count', + 'com.alibaba.nacos.page.serviceManagement.table.column.operation': 'Operation', + 'com.alibaba.nacos.page.serviceManagement.detail': 'Details', + 'com.alibaba.nacos.page.serviceManagement.delete': 'Delete', + 'com.alibaba.nacos.page.serviceManagement.prompt': 'Confirm', + 'com.alibaba.nacos.page.serviceManagement.prompt_delete': 'Do you want to delete the service?', + 'com.alibaba.nacos.page.serviceManagement.create': 'Create Service', + 'com.alibaba.nacos.page.serviceManagement.query': 'Search', + serviceManagement: 'Service Management', + 'com.alibaba.nacos.page.serviceDetail.service_details': 'Service Details', + 'com.alibaba.nacos.page.serviceDetail.create_service': 'Create Service', + 'com.alibaba.nacos.page.serviceDetail.edit_service': 'Edit Service', + 'com.alibaba.nacos.page.serviceDetail.back': 'Back', + 'com.alibaba.nacos.page.serviceDetail.service_name': 'Service Name', + 'com.alibaba.nacos.page.serviceDetail.protect_threshold': 'Protect Threshold', + 'com.alibaba.nacos.page.serviceDetail.health_check_pattern': 'Health check pattern', + 'com.alibaba.nacos.page.serviceDetail.health_check_pattern.service': 'Service', + 'com.alibaba.nacos.page.serviceDetail.health_check_pattern.client': 'Client', + 'com.alibaba.nacos.page.serviceDetail.health_check_pattern.none': 'None', + 'com.alibaba.nacos.page.serviceDetail.metadata': 'Metadata', + 'com.alibaba.nacos.page.serviceDetail.update_service': 'Update Service', + 'com.alibaba.nacos.page.serviceDetail.cluster': 'Cluster', + 'com.alibaba.nacos.page.serviceDetail.edit_cluster': 'Edit Cluster', + 'com.alibaba.nacos.page.serviceDetail.port': 'Port', + 'com.alibaba.nacos.page.serviceDetail.weight': 'Weight', + 'com.alibaba.nacos.page.serviceDetail.healthy': 'Healthy', + 'com.alibaba.nacos.page.serviceDetail.operation': 'Operation', + 'com.alibaba.nacos.page.serviceDetail.editor': 'Edit', + 'com.alibaba.nacos.page.serviceDetail.offline': 'Offline', + 'com.alibaba.nacos.page.serviceDetail.online': 'Online', + 'com.alibaba.nacos.page.serviceDetail.check_type': 'Check Type', + 'com.alibaba.nacos.page.serviceDetail.check_port': 'Check Port', + 'com.alibaba.nacos.page.serviceDetail.use_ip_port_check': 'Use port of IP', + 'com.alibaba.nacos.page.serviceDetail.check_path': 'Check Path', + 'com.alibaba.nacos.page.serviceDetail.check_headers': 'Check Headers', + 'com.alibaba.nacos.page.serviceDetail.update_cluster': 'Update Cluster', + 'com.alibaba.nacos.page.serviceDetail.update_instance': 'Update Instance', + 'com.alibaba.nacos.page.serviceDetail.whether_online': 'Whether Online', + serviceDetail: 'Service Details', + 'nacos.page.ConfigEditor.submit_failed': 'Cannot be empty, submit failed', + }, +}; diff --git a/console/src/main/resources/static/src/layouts/Header.js b/console/src/main/resources/static/src/layouts/Header.js index 098519d0c..5eadc35ef 100644 --- a/console/src/main/resources/static/src/layouts/Header.js +++ b/console/src/main/resources/static/src/layouts/Header.js @@ -12,13 +12,12 @@ */ import React from 'react'; +import PropTypes from 'prop-types'; import classnames from 'classnames'; import siteConfig from '../config'; import { getLink } from '../utils/nacosutil'; import './index.css'; - - const languageSwitch = [ { text: '中', @@ -29,7 +28,7 @@ const languageSwitch = [ value: 'zh-cn', }, ]; -const noop = () => { }; +const noop = () => {}; const defaultProps = { type: 'primary', @@ -37,8 +36,15 @@ const defaultProps = { onLanguageChange: noop, }; - class Header extends React.Component { + static propTypes = { + language: PropTypes.string, + type: PropTypes.string, + logo: PropTypes.string, + currentKey: PropTypes.string, + onLanguageChange: PropTypes.func, + }; + constructor(props) { super(props); this.state = { @@ -79,43 +85,34 @@ class Header extends React.Component { const { menuBodyVisible, language } = this.state; return (
{siteConfig.name} - { - onLanguageChange !== noop ? - ( - {languageSwitch.find(lang => lang.value === language).text} - ) - : - null - } + {onLanguageChange !== noop ? ( + + {languageSwitch.find(lang => lang.value === language).text} + + ) : null}
diff --git a/console/src/main/resources/static/src/layouts/MainLayout.js b/console/src/main/resources/static/src/layouts/MainLayout.js index 5a87027d4..0f089dcde 100644 --- a/console/src/main/resources/static/src/layouts/MainLayout.js +++ b/console/src/main/resources/static/src/layouts/MainLayout.js @@ -12,6 +12,7 @@ */ import React from 'react'; +import PropTypes from 'prop-types'; import { Icon } from '@alifd/next'; import siteConfig from '../config'; import Header from './Header'; @@ -19,432 +20,449 @@ import $ from 'jquery'; import { aliwareGetCookieByKeyName, setParams, aliwareIntl } from '../globalLib'; export default class MainLayout extends React.Component { - constructor(props) { - super(props); - this.initNav = this.props.navList; - this.deepNav = []; - this.oneLevelNavArr = {}; //平行导航map - this.state = { - leftBarClose: false, - showLink: null, - navRow: [], - noChild: false - }; - } + static propTypes = { + navList: PropTypes.array, + history: PropTypes.object, + children: PropTypes.any, + }; - goBack() { - this.props.history.goBack(); - } - - nacosToggleNav(id, event) { - event.preventDefault(); - let nowNav = document.getElementById(id); - let iconClass = nowNav.querySelector('.iconshow'); - let subNav = nowNav.querySelector('.subnavlist'); - let classList = iconClass.classList; - let tmpClassName = 'iconshow '; - for (let i = 0; i < classList.length; i++) { - if (classList[i] === 'icon-arrow-down') { - subNav.style.display = 'none'; - subNav.className += ' hidden'; - tmpClassName += 'icon-arrow-right'; - } - if (classList[i] === 'icon-arrow-right') { - tmpClassName += 'icon-arrow-down'; - subNav.className = subNav.className.replace(/hidden/g, ''); - subNav.style.display = 'block'; - } - } - iconClass.className = tmpClassName; - } - - nacosGoBack(url) { - let params = window.location.hash.split('?')[1]; - let urlArr = params.split('&') || []; - let queryParams = []; - for (let i = 0; i < urlArr.length; i++) { - if ( - urlArr[i].split('=')[0] !== '_k' && - urlArr[i].split('=')[0] !== 'dataId' && - urlArr[i].split('=')[0] !== 'group' - ) { - if (urlArr[i].split('=')[0] === 'searchDataId') { - queryParams.push(`dataId=${urlArr[i].split('=')[1]}`); - } else if (urlArr[i].split('=')[0] === 'searchGroup') { - queryParams.push(`group=${urlArr[i].split('=')[1]}`); - } else { - queryParams.push(urlArr[i]); - } - } - } - this.props.history.push(`/${url}?${queryParams.join('&')}`); - } - - nacosEnterBack() { - document.getElementById('backarrow').style.color = '#09c'; - } - - nacosOutBack() { - document.getElementById('backarrow').style.color = '#546478'; - } - - nacosToggleLeftBar() { - if (!this.nacosOutDom) return - if (!this.state.leftBarClose) { - //关闭 - this.nacosOutDom.className = 'viewFramework-product'; - this.nacosLeftBarDom.style.width = 0; - this.nacosBodyDom.style.left = 0; - this.nacosToggleIconDom.style.left = 0; - } else { - this.nacosOutDom.className = 'viewFramework-product viewFramework-product-col-1'; - this.nacosLeftBarDom.style.width = '180px'; - this.nacosBodyDom.style.left = '180px'; - this.nacosToggleIconDom.style.left = '160px'; - } - - this.setState({ - leftBarClose: !this.state.leftBarClose - }); - } - - navTo(url) { - if (url !== '/configdetail' && url !== '/configeditor') { - //二级菜单不清空 - setParams({ - dataId: '', - group: '' - }); - } - - let params = window.location.hash.split('?')[1]; - let urlArr = params.split('&') || []; - let queryParams = []; - for (let i = 0; i < urlArr.length; i++) { - if (urlArr[i].split('=')[0] !== '_k') { - queryParams.push(urlArr[i]); - } - } - - this.props.history.push(`${url}?${queryParams.join('&')}`); - } - - nacosSetSpecialNav(item) { - item.children.forEach((_item) => { - let obj = _item; - - if (obj.dontUseChild === true) { - obj.parentName = item.title; - obj.parentId = item.id; - obj.parentPath = '/' + item.id; - this.deepNav.push(obj); - } - if (_item.children) { - this.nacosSetSpecialNav(_item); - } - }); - } - - nacosNavAct(serviceName, match, location) { - if (!match) { - let formatpath = location.pathname.substr(1); //得到当前路径 - let nowpathobj = this.oneLevelNavArr[formatpath]; //根据平行导航匹配父类 - if (nowpathobj) { - if (nowpathobj.parent === serviceName) { - //如果父类等于当前的导航则高亮 - return true; - } - } - - return false; - } - return true; - } - - nacosLoopNavDeeply(data, parentServiceName) { - //深度遍历获取所有的导航数据 - data.forEach((item) => { - if (item) { - let navObj = item, - _parentServiceName = item.serviceName; - navObj.parentServiceName = parentServiceName; - this.oneLevelNavArr[item.serviceName] = navObj; //得到每一个层级的导航映射 - if (item.children && item.children.length > 0) { - this.nacosLoopNavDeeply(item.children, _parentServiceName); - } - } - }); - } - - activeNav(id) { - if (this.preActNav) { - this.preActNav.removeClass('active'); - } - let nowNav = $(`#${id}`); - nowNav.addClass('active'); - this.preActNav = nowNav; - } - - nacosLoopNav(data, index = 0, parent) { - //遍历导航,只显示2级 - let self = this; - return data.map((item) => { - if (!item) { - return ''; - } - index++; - if (item.dontUseChild === true) { - return ''; - } - if (item.children && item.children.length > 0) { - if (item.isVirtual) { - //如果是虚拟菜单需要增加展开箭头 - let icon = item.isExtend ? ( - - ) : ( - - ); - let hiddenClass = item.isExtend ? '' : 'hidden'; - return ( -
  • - -
      {self.nacosLoopNav(item.children, index)}
    -
  • - ); - } else { - return ( -
  • - -
  • - ); - } - } - return ( -
  • - -
  • - ); - }); - } - - nacosGetNav(navList) { - let navRow = ''; //导航 - if (navList.length > 0) { - navRow =
      {this.nacosLoopNav(navList)}
    ; - this.nacosLoopNavDeeply(navList); //深度遍历导航树获得平行map - } - return navRow; - } - - UNSAFE_componentWillMount() { - let nav = this.props.navList || []; - let navRow = this.nacosGetNav(nav); - this.setState({ - navRow: navRow - }); - } - - componentDidMount() { - this.nacosLeftBarDom = document.getElementById('viewFramework-product-navbar'); - this.nacosBodyDom = document.getElementById('viewFramework-product-body'); - this.nacosToggleIconDom = document.getElementById('viewFramework-product-navbar-collapse'); - this.nacosOutDom = document.getElementById('page-header-mask'); - // let parentNav = this.initNav[0] || []; - let defaultNav = '/configurationManagement'; - // let childrenNav = parentNav.children || []; - this.props.history.listen((location) => { - if (this.preSimplePath && this.preSimplePath !== '/') { - if (location.pathname.indexOf(this.preSimplePath) !== -1) { - return; - } - } - let simplePath = window.location.hash.split('?')[0]; - let navName = simplePath.substr('2'); - this.preSimplePath = simplePath; - - if (navName === '') { - this.props.history.push(defaultNav); - setTimeout(() => { - this.activeNav('configurationManagement'); - }); - return; - } - - let nowNavObj = this.oneLevelNavArr[navName]; - if (!nowNavObj) { - this.setState({ - noChild: true - }); - return; - } - this.setState({ - noChild: !!nowNavObj.dontUseChild - }); - let parentServiceName = nowNavObj.parentServiceName, - parentNav = this.oneLevelNavArr[parentServiceName]; - if (simplePath !== '/' && nowNavObj && parentNav && !parentNav.isVirtual) { - this.setState({ - showLink: ( -
    - -
    - ), - - navRow:
      {this.nacosLoopNav([nowNavObj])}
    - }); - setTimeout(() => { - let navid = navName; - this.activeNav(navid); - }); - } else { - this.setState({ - showLink: null, - navRow:
      {this.nacosLoopNav(this.initNav)}
    - }); - setTimeout(() => { - let navid = navName; - this.activeNav(navid); - }); - } - }); - } - - onLanguageChange = (language) => { - aliwareIntl.changeLanguage(language); - document.cookie = `docsite_language=${language}`; - window.location.reload(); + constructor(props) { + super(props); + this.initNav = this.props.navList; + this.deepNav = []; + this.oneLevelNavArr = {}; // 平行导航map + this.state = { + leftBarClose: false, + showLink: null, + navRow: [], + noChild: false, }; + } - render() { - let language = aliwareGetCookieByKeyName('docsite_language') || siteConfig.defaultLanguage; + goBack() { + this.props.history.goBack(); + } - const { headerType, showLink, navRow, leftBarClose, noChild } = this.state; - const headerLogo = `${process.env.NODE_ENV === 'development' ? '' : 'public/'}img/TB118jPv_mWBKNjSZFBXXXxUFXa-2000-390.svg`; - return ( -
    -
    -
    -
    -
    -
    - {showLink ? ( -
    - {showLink} -
    - ) : ( -
    - - {aliwareIntl.get( - 'com.alibaba.nacos.layout.noenv.app_configuration_management_acm' - )} - - - {aliwareIntl.get( - 'com.alibaba.nacos.layout.noenv.nacosversion' - )} - -
    - )} - -
    - {navRow} -
    -
    -
    -
    -
    -
    -
    -
    -
    - {leftBarClose ? ( - - ) : ( - - )} -
    -
    -
    -
    -
    - {!noChild ? ( -
    {this.props.children}
    - ) : ( -
    - {aliwareIntl.get('com.alibaba.nacos.layout.noenv.does_not_exist')} -
    - )} -
    -
    -
    - ); + nacosToggleNav(id, event) { + event.preventDefault(); + const nowNav = document.getElementById(id); + const iconClass = nowNav.querySelector('.iconshow'); + const subNav = nowNav.querySelector('.subnavlist'); + const { classList } = iconClass; + let tmpClassName = 'iconshow '; + for (let i = 0; i < classList.length; i++) { + if (classList[i] === 'icon-arrow-down') { + subNav.style.display = 'none'; + subNav.className += ' hidden'; + tmpClassName += 'icon-arrow-right'; + } + if (classList[i] === 'icon-arrow-right') { + tmpClassName += 'icon-arrow-down'; + subNav.className = subNav.className.replace(/hidden/g, ''); + subNav.style.display = 'block'; + } } + iconClass.className = tmpClassName; + } + + nacosGoBack(url) { + const params = window.location.hash.split('?')[1]; + const urlArr = params.split('&') || []; + const queryParams = []; + for (let i = 0; i < urlArr.length; i++) { + if ( + urlArr[i].split('=')[0] !== '_k' && + urlArr[i].split('=')[0] !== 'dataId' && + urlArr[i].split('=')[0] !== 'group' + ) { + if (urlArr[i].split('=')[0] === 'searchDataId') { + queryParams.push(`dataId=${urlArr[i].split('=')[1]}`); + } else if (urlArr[i].split('=')[0] === 'searchGroup') { + queryParams.push(`group=${urlArr[i].split('=')[1]}`); + } else { + queryParams.push(urlArr[i]); + } + } + } + this.props.history.push(`/${url}?${queryParams.join('&')}`); + } + + nacosEnterBack() { + document.getElementById('backarrow').style.color = '#09c'; + } + + nacosOutBack() { + document.getElementById('backarrow').style.color = '#546478'; + } + + nacosToggleLeftBar() { + if (!this.nacosOutDom) return; + if (!this.state.leftBarClose) { + // 关闭 + this.nacosOutDom.className = 'viewFramework-product'; + this.nacosLeftBarDom.style.width = 0; + this.nacosBodyDom.style.left = 0; + this.nacosToggleIconDom.style.left = 0; + } else { + this.nacosOutDom.className = 'viewFramework-product viewFramework-product-col-1'; + this.nacosLeftBarDom.style.width = '180px'; + this.nacosBodyDom.style.left = '180px'; + this.nacosToggleIconDom.style.left = '160px'; + } + + this.setState({ + leftBarClose: !this.state.leftBarClose, + }); + } + + navTo(url) { + if (url !== '/configdetail' && url !== '/configeditor') { + // 二级菜单不清空 + setParams({ + dataId: '', + group: '', + }); + } + + const params = window.location.hash.split('?')[1]; + const urlArr = params.split('&') || []; + const queryParams = []; + for (let i = 0; i < urlArr.length; i++) { + if (urlArr[i].split('=')[0] !== '_k') { + queryParams.push(urlArr[i]); + } + } + + this.props.history.push(`${url}?${queryParams.join('&')}`); + } + + nacosSetSpecialNav(item) { + item.children.forEach(_item => { + const obj = _item; + + if (obj.dontUseChild === true) { + obj.parentName = item.title; + obj.parentId = item.id; + obj.parentPath = `/${item.id}`; + this.deepNav.push(obj); + } + if (_item.children) { + this.nacosSetSpecialNav(_item); + } + }); + } + + nacosNavAct(serviceName, match, location) { + if (!match) { + const formatpath = location.pathname.substr(1); // 得到当前路径 + const nowpathobj = this.oneLevelNavArr[formatpath]; // 根据平行导航匹配父类 + if (nowpathobj) { + if (nowpathobj.parent === serviceName) { + // 如果父类等于当前的导航则高亮 + return true; + } + } + + return false; + } + return true; + } + + nacosLoopNavDeeply(data, parentServiceName) { + // 深度遍历获取所有的导航数据 + data.forEach(item => { + if (item) { + const navObj = item; + + const _parentServiceName = item.serviceName; + navObj.parentServiceName = parentServiceName; + this.oneLevelNavArr[item.serviceName] = navObj; // 得到每一个层级的导航映射 + if (item.children && item.children.length > 0) { + this.nacosLoopNavDeeply(item.children, _parentServiceName); + } + } + }); + } + + activeNav(id) { + if (this.preActNav) { + this.preActNav.removeClass('active'); + } + const nowNav = $(`#${id}`); + nowNav.addClass('active'); + this.preActNav = nowNav; + } + + nacosLoopNav(data, _index = 0, parent) { + let index = _index; + // 遍历导航,只显示2级 + const self = this; + return data.map(item => { + if (!item) { + return ''; + } + index++; + if (item.dontUseChild === true) { + return ''; + } + if (item.children && item.children.length > 0) { + if (item.isVirtual) { + // 如果是虚拟菜单需要增加展开箭头 + const icon = item.isExtend ? ( + + ) : ( + + ); + const hiddenClass = item.isExtend ? '' : 'hidden'; + return ( +
  • + +
      + {self.nacosLoopNav(item.children, index)} +
    +
  • + ); + } else { + return ( +
  • + +
  • + ); + } + } + return ( +
  • + +
  • + ); + }); + } + + nacosGetNav(navList) { + let navRow = ''; // 导航 + if (navList.length > 0) { + navRow =
      {this.nacosLoopNav(navList)}
    ; + this.nacosLoopNavDeeply(navList); // 深度遍历导航树获得平行map + } + return navRow; + } + + UNSAFE_componentWillMount() { + const nav = this.props.navList || []; + const navRow = this.nacosGetNav(nav); + this.setState({ + navRow, + }); + } + + componentDidMount() { + this.nacosLeftBarDom = document.getElementById('viewFramework-product-navbar'); + this.nacosBodyDom = document.getElementById('viewFramework-product-body'); + this.nacosToggleIconDom = document.getElementById('viewFramework-product-navbar-collapse'); + this.nacosOutDom = document.getElementById('page-header-mask'); + // let parentNav = this.initNav[0] || []; + const defaultNav = '/configurationManagement'; + // let childrenNav = parentNav.children || []; + this.props.history.listen(location => { + if (this.preSimplePath && this.preSimplePath !== '/') { + if (location.pathname.indexOf(this.preSimplePath) !== -1) { + return; + } + } + const simplePath = window.location.hash.split('?')[0]; + const navName = simplePath.substr('2'); + this.preSimplePath = simplePath; + + if (navName === '') { + this.props.history.push(defaultNav); + setTimeout(() => { + this.activeNav('configurationManagement'); + }); + return; + } + + const nowNavObj = this.oneLevelNavArr[navName]; + if (!nowNavObj) { + this.setState({ + noChild: true, + }); + return; + } + this.setState({ + noChild: !!nowNavObj.dontUseChild, + }); + const { parentServiceName } = nowNavObj; + + const parentNav = this.oneLevelNavArr[parentServiceName]; + if (simplePath !== '/' && nowNavObj && parentNav && !parentNav.isVirtual) { + this.setState({ + showLink: ( +
    + +
    + ), + + navRow:
      {this.nacosLoopNav([nowNavObj])}
    , + }); + setTimeout(() => { + const navid = navName; + this.activeNav(navid); + }); + } else { + this.setState({ + showLink: null, + navRow:
      {this.nacosLoopNav(this.initNav)}
    , + }); + setTimeout(() => { + const navid = navName; + this.activeNav(navid); + }); + } + }); + } + + onLanguageChange = language => { + aliwareIntl.changeLanguage(language); + document.cookie = `docsite_language=${language}`; + window.location.reload(); + }; + + render() { + const language = aliwareGetCookieByKeyName('docsite_language') || siteConfig.defaultLanguage; + + const { headerType, showLink, navRow, leftBarClose, noChild } = this.state; + const headerLogo = `${ + process.env.NODE_ENV === 'development' ? '' : 'public/' + }img/TB118jPv_mWBKNjSZFBXXXxUFXa-2000-390.svg`; + return ( +
    +
    +
    +
    +
    +
    + {showLink ? ( +
    + {showLink} +
    + ) : ( +
    + + {aliwareIntl.get( + 'com.alibaba.nacos.layout.noenv.app_configuration_management_acm' + )} + + + {aliwareIntl.get('com.alibaba.nacos.layout.noenv.nacosversion')} + +
    + )} + +
    + {navRow} +
    +
    +
    +
    +
    +
    +
    +
    +
    + {leftBarClose ? ( + + ) : ( + + )} +
    +
    +
    +
    +
    + {!noChild ? ( +
    {this.props.children}
    + ) : ( +
    + {aliwareIntl.get('com.alibaba.nacos.layout.noenv.does_not_exist')} +
    + )} +
    +
    +
    + ); + } } diff --git a/console/src/main/resources/static/src/lib.js b/console/src/main/resources/static/src/lib.js index 51cc09d1d..8fce9ba4c 100644 --- a/console/src/main/resources/static/src/lib.js +++ b/console/src/main/resources/static/src/lib.js @@ -12,194 +12,194 @@ */ import { getParams, request, aliwareIntl } from './globalLib'; -var hasAlert = false; +let hasAlert = false; -window.edasprefix = 'acm'; //固定的edas网关需要的项目名 +window.edasprefix = 'acm'; // 固定的edas网关需要的项目名 window.globalConfig = { - isParentEdas: function () { - try { - if (window.parent.location.host.indexOf('edas') !== -1) { - return true; - } - } catch (error) { } - return false; - } + isParentEdas() { + try { + if (window.parent.location.host.indexOf('edas') !== -1) { + return true; + } + } catch (error) {} + return false; + }, }; -request.middleWare(config => { - let url = config.url; - let tenant = window.nownamespace || getParams('namespace') || ''; - tenant = tenant === 'global' ? '' : tenant; - let splitArr = url.split('?'); - if (splitArr.length > 1) { - let params = splitArr[1]; - if (params.indexOf('dataId') !== -1) { - url += '&tenant=' + tenant; - config.url = url; - } +request.middleWare((_config = {}) => { + let config = _config; + let { url = '' } = config; + let tenant = window.nownamespace || getParams('namespace') || ''; + tenant = tenant === 'global' ? '' : tenant; + const splitArr = url.split('?'); + if (splitArr.length > 1) { + const params = splitArr[1]; + if (params.indexOf('dataId') !== -1) { + url += `&tenant=${tenant}`; + config.url = url; } + } - let preSucess = config.success; - let preErorr = config.error; + const preSucess = config.success; + const preErorr = config.error; - config.success = function (res) { + config.success = function(res) { + if (res.code === 'ConsoleNeedLogin' && window.location.host.indexOf('acm') !== -1) { + window.location.reload(); + } + if (res.code === 403 && !hasAlert) { + hasAlert = true; + window.Dialog.alert({ + language: aliwareIntl.currentLanguageCode || 'zh-cn', + style: { width: 400 }, + content: res.message, + onOk: () => { + hasAlert = false; + }, + onCancel: () => { + hasAlert = false; + }, + onClose: () => { + hasAlert = false; + }, + }); + } else { + typeof preSucess === 'function' && preSucess(res); + } + }; - if (res.code === 'ConsoleNeedLogin' && window.location.host.indexOf('acm') !== -1) { - window.location.reload(); - } - if (res.code === 403 && !hasAlert) { - hasAlert = true; - window.Dialog.alert({ - language: aliwareIntl.currentLanguageCode || 'zh-cn', - style: { width: 400 }, - content: res.message, - onOk: () => { - hasAlert = false; - }, - onCancel: () => { - hasAlert = false; - }, - onClose: () => { - hasAlert = false; - } - }); - return; - } else { - typeof preSucess === "function" && preSucess(res); - } - }; + config.error = function(res) { + if (res.status === 403 && !hasAlert) { + hasAlert = true; - config.error = function (res) { - if (res.status === 403 && !hasAlert) { - hasAlert = true; + window.Dialog.alert({ + language: aliwareIntl.currentLanguageCode || 'zh-cn', + style: { width: 400 }, + content: aliwareIntl.get('com.alibaba.nacos.pubshow'), // '子账号没有权限,请联系主账号负责人RAM上授权', + onOk: () => { + hasAlert = false; + }, + onCancel: () => { + hasAlert = false; + }, + onClose: () => { + hasAlert = false; + }, + }); + } else { + typeof preErorr === 'function' && preErorr(res); + } + }; - window.Dialog.alert({ - language: aliwareIntl.currentLanguageCode || 'zh-cn', - style: { width: 400 }, - content: aliwareIntl.get('com.alibaba.nacos.pubshow'), //'子账号没有权限,请联系主账号负责人RAM上授权', - onOk: () => { - hasAlert = false; - }, - onCancel: () => { - hasAlert = false; - }, - onClose: () => { - hasAlert = false; - } - }); - return; - } else { - typeof preErorr === "function" && preErorr(res); - } - }; - - return config; + return config; }); /** * 配置 monaco */ -window.require.config({ paths: { 'vs': process.env.NODE_ENV === 'development' ? 'js/vs' : 'public/js/vs' } }); window.require.config({ - 'vs/nls': { - availableLanguages: { - '*': 'zh-cn' - } - } + paths: { vs: process.env.NODE_ENV === 'development' ? 'js/vs' : 'public/js/vs' }, +}); +window.require.config({ + 'vs/nls': { + availableLanguages: { + '*': 'zh-cn', + }, + }, }); window.require(['vs/editor/editor.main'], () => { - // Register a new language - window.monaco.languages.register({ id: 'properties' }); + // Register a new language + window.monaco.languages.register({ id: 'properties' }); - // Register a tokens provider for the language - window.monaco.languages.setMonarchTokensProvider('properties', { - tokenizer: { - root: [[/^\#.*/, 'comment'], [/.*\=/, 'key'], [/^=.*/, 'value']] - } - }); + // Register a tokens provider for the language + window.monaco.languages.setMonarchTokensProvider('properties', { + tokenizer: { + root: [[/^\#.*/, 'comment'], [/.*\=/, 'key'], [/^=.*/, 'value']], + }, + }); - // Define a new theme that constains only rules that match this language - window.monaco.editor.defineTheme('properties', { - base: 'vs', - inherit: false, - rules: [{ token: 'key', foreground: '009968' }, { token: 'value', foreground: '009968' }, { token: 'comment', foreground: '666666' }] - }); + // Define a new theme that constains only rules that match this language + window.monaco.editor.defineTheme('properties', { + base: 'vs', + inherit: false, + rules: [ + { token: 'key', foreground: '009968' }, + { token: 'value', foreground: '009968' }, + { token: 'comment', foreground: '666666' }, + ], + }); - // Register a completion item provider for the new language - window.monaco.languages.registerCompletionItemProvider('properties', { - provideCompletionItems: () => { - return [{ - label: 'simpleText', - kind: window.monaco.languages.CompletionItemKind.Text - }, { - label: 'testing', - kind: window.monaco.languages.CompletionItemKind.Keyword, - insertText: { - value: `testing(\${1:condition})` - } - }, { - label: 'ifelse', - kind: window.monaco.languages.CompletionItemKind.Snippet, - insertText: { - value: [`if (\${1:condition}) {`, '\t$0', '} else {', '\t', '}'].join('\n') - }, - documentation: 'If-Else Statement' - }]; - } - }); + // Register a completion item provider for the new language + window.monaco.languages.registerCompletionItemProvider('properties', { + provideCompletionItems: () => [ + { + label: 'simpleText', + kind: window.monaco.languages.CompletionItemKind.Text, + }, + { + label: 'testing', + kind: window.monaco.languages.CompletionItemKind.Keyword, + insertText: { + value: 'testing(${1:condition})', + }, + }, + { + label: 'ifelse', + kind: window.monaco.languages.CompletionItemKind.Snippet, + insertText: { + value: ['if (${1:condition}) {', '\t$0', '} else {', '\t', '}'].join('\n'), + }, + documentation: 'If-Else Statement', + }, + ], + }); }); window.importEditor = callback => { - window.require(['vs/editor/editor.main'], () => { - callback && callback(); - }); + window.require(['vs/editor/editor.main'], () => { + callback && callback(); + }); }; -//同步获取命名空间地址 - -window._getLink = function () { - let _linkObj = {}; - // request({ - // url: "com.alibaba.nacos.service.getLinks", - // async: false, - // data: {}, - // success: res => { - // if (res.code === 200) { - // _linkObj = res.data; - // } - // } - // }); - return function (linkName) { - return _linkObj[linkName] || ""; - }; -}(window); +// 同步获取命名空间地址 +window._getLink = (function() { + const _linkObj = {}; + // request({ + // url: "com.alibaba.nacos.service.getLinks", + // async: false, + // data: {}, + // success: res => { + // if (res.code === 200) { + // _linkObj = res.data; + // } + // } + // }); + return function(linkName) { + return _linkObj[linkName] || ''; + }; +})(window); window.addEventListener('resize', () => { - try { - - if (this.timmer) { - clearTimeout(this.timmer); - } - this.timmer = setTimeout(() => { - let height = document.body.clientHeight; - height = height > 800 ? height : 800; - window.parent.adjustHeight && window.parent.adjustHeight(height); - }, 500); - } catch (e) { - + try { + if (this.timmer) { + clearTimeout(this.timmer); } -}) -//判断是否是国际站国际用户 -window.isIntel = function () { - - let host = window.location.host; - if (host.indexOf('alibabacloud.com') !== -1) { - return true; - } else { - return false; - } - -} \ No newline at end of file + this.timmer = setTimeout(() => { + let height = document.body.clientHeight; + height = height > 800 ? height : 800; + window.parent.adjustHeight && window.parent.adjustHeight(height); + }, 500); + } catch (e) {} +}); +// 判断是否是国际站国际用户 +window.isIntel = function() { + const { host } = window.location; + if (host.indexOf('alibabacloud.com') !== -1) { + return true; + } else { + return false; + } +}; diff --git a/console/src/main/resources/static/src/menu.js b/console/src/main/resources/static/src/menu.js index 4dd571ee8..79ef76d99 100644 --- a/console/src/main/resources/static/src/menu.js +++ b/console/src/main/resources/static/src/menu.js @@ -12,219 +12,219 @@ */ module.exports = { - "data": [ + data: [ + { + isExtend: true, + name: '配置管理', + title: '配置管理', + isVirtual: true, + projectName: 'nacos', + serviceName: 'configurationManagementVirtual', + link: 'configurationManagementVirtual', + hasFusion: true, + template: '', + registerName: 'com.alibaba.nacos.page.configurationManagementVirtual', + useRouter: false, + id: 'com.alibaba.nacos.page.configurationManagementVirtual', + children: [ { - "isExtend": true, - "name": "配置管理", - "title": "配置管理", - "isVirtual": true, - "projectName": "nacos", - "serviceName": "configurationManagementVirtual", - "link": "configurationManagementVirtual", - "hasFusion": true, - "template": "", - "registerName": "com.alibaba.nacos.page.configurationManagementVirtual", - "useRouter": false, - "id": "com.alibaba.nacos.page.configurationManagementVirtual", - "children": [ - { - "isExtend": false, - "name": "配置列表", - "title": "配置列表", - "isVirtual": false, - "projectName": "nacos", - "serviceName": "configurationManagement", - "link": "configurationManagement", - "hasFusion": true, - "template": "", - "dontUseChild": false, - "registerName": "com.alibaba.nacos.page.configurationManagement", - "useRouter": false, - "id": "configurationManagement", - "children": [ - { - "isExtend": false, - "name": "配置详情", - "title": "配置详情", - "isVirtual": false, - "projectName": "nacos", - "serviceName": "configdetail", - "link": "Configdetail", - "hasFusion": true, - "template": "", - "dontUseChild": false, - "registerName": "com.alibaba.nacos.page.configdetail", - "useRouter": false, - "id": "configdetail" - }, - { - "isExtend": false, - "name": "同步配置", - "title": "同步配置", - "isVirtual": false, - "projectName": "nacos", - "serviceName": "configsync", - "link": "configsync", - "hasFusion": true, - "template": "", - "dontUseChild": true, - "registerName": "com.alibaba.nacos.page.configsync", - "useRouter": false, - "id": "configsync" - }, - { - "isExtend": false, - "name": "配置编辑", - "title": "配置编辑", - "isVirtual": false, - "projectName": "nacos", - "serviceName": "configeditor", - "link": "configeditor", - "hasFusion": true, - "template": "", - "registerName": "com.alibaba.nacos.page.configeditor", - "useRouter": false, - "id": "configeditor" - }, - { - "isExtend": false, - "name": "新建配置", - "title": "新建配置", - "isVirtual": false, - "projectName": "nacos", - "serviceName": "newconfig", - "link": "newconfig", - "hasFusion": true, - "template": "", - "registerName": "com.alibaba.nacos.page.newconfig", - "useRouter": false, - "id": "newconfig" - } - ] - }, - { - "isExtend": false, - "name": "历史版本", - "title": "历史版本", - "isVirtual": false, - "projectName": "nacos", - "children": [ - { - "isExtend": false, - "name": "配置回滚", - "title": "配置回滚", - "isVirtual": false, - "projectName": "nacos", - "serviceName": "configRollback", - "link": "configRollback", - "hasFusion": true, - "template": "", - "registerName": "com.alibaba.nacos.page.configRollback", - "useRouter": false, - "id": "configRollback" - }, - { - "isExtend": false, - "name": "历史详情", - "title": "历史详情", - "isVirtual": false, - "projectName": "nacos", - "serviceName": "historyDetail", - "link": "historyDetail", - "hasFusion": true, - "template": "", - "registerName": "com.alibaba.nacos.page.historyDetail", - "useRouter": false, - "id": "historyDetail" - } - ], - "serviceName": "historyRollback", - "link": "historyRollback", - "hasFusion": true, - "template": "", - "dontUseChild": false, - "registerName": "com.alibaba.nacos.page.historyRollback", - "useRouter": false, - "id": "historyRollback" - }, - { - "isExtend": false, - "name": "监听查询", - "title": "监听查询", - "isVirtual": false, - "projectName": "nacos", - "serviceName": "listeningToQuery", - "link": "listeningToQuery", - "hasFusion": true, - "template": "", - "registerName": "com.alibaba.nacos.page.listeningToQuery", - "useRouter": false, - "id": "listeningToQuery" - } - ] + isExtend: false, + name: '配置列表', + title: '配置列表', + isVirtual: false, + projectName: 'nacos', + serviceName: 'configurationManagement', + link: 'configurationManagement', + hasFusion: true, + template: '', + dontUseChild: false, + registerName: 'com.alibaba.nacos.page.configurationManagement', + useRouter: false, + id: 'configurationManagement', + children: [ + { + isExtend: false, + name: '配置详情', + title: '配置详情', + isVirtual: false, + projectName: 'nacos', + serviceName: 'configdetail', + link: 'Configdetail', + hasFusion: true, + template: '', + dontUseChild: false, + registerName: 'com.alibaba.nacos.page.configdetail', + useRouter: false, + id: 'configdetail', + }, + { + isExtend: false, + name: '同步配置', + title: '同步配置', + isVirtual: false, + projectName: 'nacos', + serviceName: 'configsync', + link: 'configsync', + hasFusion: true, + template: '', + dontUseChild: true, + registerName: 'com.alibaba.nacos.page.configsync', + useRouter: false, + id: 'configsync', + }, + { + isExtend: false, + name: '配置编辑', + title: '配置编辑', + isVirtual: false, + projectName: 'nacos', + serviceName: 'configeditor', + link: 'configeditor', + hasFusion: true, + template: '', + registerName: 'com.alibaba.nacos.page.configeditor', + useRouter: false, + id: 'configeditor', + }, + { + isExtend: false, + name: '新建配置', + title: '新建配置', + isVirtual: false, + projectName: 'nacos', + serviceName: 'newconfig', + link: 'newconfig', + hasFusion: true, + template: '', + registerName: 'com.alibaba.nacos.page.newconfig', + useRouter: false, + id: 'newconfig', + }, + ], }, { - "isExtend": true, - "name": "服务管理", - "title": "服务管理", - "isVirtual": true, - "projectName": "nacos", - "serviceName": "serviceManagementVirtual", - "link": "serviceManagementVirtual", - "hasFusion": true, - "template": "", - "registerName": "com.alibaba.nacos.page.serviceManagementVirtual", - "useRouter": false, - "id": "com.alibaba.nacos.page.serviceManagementVirtual", - "children": [ - { - "isExtend": false, - "name": "服务列表", - "title": "服务列表", - "isVirtual": false, - "projectName": "nacos", - "serviceName": "serviceManagement", - "link": "serviceManagement", - "hasFusion": true, - "template": "", - "registerName": "com.alibaba.nacos.page.serviceManagement", - "useRouter": false, - "id": "serviceManagement", - "children":[ - { - "isExtend": true, - "name": "服务详情", - "title": "服务详情", - "isVirtual": true, - "projectName": "nacos", - "serviceName": "serviceDetail", - "link": "serviceDetail", - "hasFusion": true, - "template": "", - "registerName": "com.alibaba.nacos.page.ServiceDetail", - "useRouter": false, - "id": "serviceDetail", - } - ] - } - ] + isExtend: false, + name: '历史版本', + title: '历史版本', + isVirtual: false, + projectName: 'nacos', + children: [ + { + isExtend: false, + name: '配置回滚', + title: '配置回滚', + isVirtual: false, + projectName: 'nacos', + serviceName: 'configRollback', + link: 'configRollback', + hasFusion: true, + template: '', + registerName: 'com.alibaba.nacos.page.configRollback', + useRouter: false, + id: 'configRollback', + }, + { + isExtend: false, + name: '历史详情', + title: '历史详情', + isVirtual: false, + projectName: 'nacos', + serviceName: 'historyDetail', + link: 'historyDetail', + hasFusion: true, + template: '', + registerName: 'com.alibaba.nacos.page.historyDetail', + useRouter: false, + id: 'historyDetail', + }, + ], + serviceName: 'historyRollback', + link: 'historyRollback', + hasFusion: true, + template: '', + dontUseChild: false, + registerName: 'com.alibaba.nacos.page.historyRollback', + useRouter: false, + id: 'historyRollback', }, { - "isExtend": false, - "name": "命名空间", - "title": "命名空间", - "isVirtual": false, - "projectName": "nacos", - "serviceName": "namespace", - "link": "namespace", - "hasFusion": true, - "template": "", - "dontUseChild": false, - "registerName": "com.alibaba.nacos.page.namespace", - "useRouter": false, - "id": "namespace" - } - ], - "defaultKey": "configurationManagement", - "projectName": "nacos" -} + isExtend: false, + name: '监听查询', + title: '监听查询', + isVirtual: false, + projectName: 'nacos', + serviceName: 'listeningToQuery', + link: 'listeningToQuery', + hasFusion: true, + template: '', + registerName: 'com.alibaba.nacos.page.listeningToQuery', + useRouter: false, + id: 'listeningToQuery', + }, + ], + }, + { + isExtend: true, + name: '服务管理', + title: '服务管理', + isVirtual: true, + projectName: 'nacos', + serviceName: 'serviceManagementVirtual', + link: 'serviceManagementVirtual', + hasFusion: true, + template: '', + registerName: 'com.alibaba.nacos.page.serviceManagementVirtual', + useRouter: false, + id: 'com.alibaba.nacos.page.serviceManagementVirtual', + children: [ + { + isExtend: false, + name: '服务列表', + title: '服务列表', + isVirtual: false, + projectName: 'nacos', + serviceName: 'serviceManagement', + link: 'serviceManagement', + hasFusion: true, + template: '', + registerName: 'com.alibaba.nacos.page.serviceManagement', + useRouter: false, + id: 'serviceManagement', + children: [ + { + isExtend: true, + name: '服务详情', + title: '服务详情', + isVirtual: true, + projectName: 'nacos', + serviceName: 'serviceDetail', + link: 'serviceDetail', + hasFusion: true, + template: '', + registerName: 'com.alibaba.nacos.page.ServiceDetail', + useRouter: false, + id: 'serviceDetail', + }, + ], + }, + ], + }, + { + isExtend: false, + name: '命名空间', + title: '命名空间', + isVirtual: false, + projectName: 'nacos', + serviceName: 'namespace', + link: 'namespace', + hasFusion: true, + template: '', + dontUseChild: false, + registerName: 'com.alibaba.nacos.page.namespace', + useRouter: false, + id: 'namespace', + }, + ], + defaultKey: 'configurationManagement', + projectName: 'nacos', +}; diff --git a/console/src/main/resources/static/src/models/error.js b/console/src/main/resources/static/src/models/error.js index 77482a8bf..e3a5905df 100644 --- a/console/src/main/resources/static/src/models/error.js +++ b/console/src/main/resources/static/src/models/error.js @@ -14,32 +14,32 @@ export default { - namespace: 'error', + namespace: 'error', - state: { - errinfo: '未知错误', - errcode: 0, - erralert: false, - }, + state: { + errinfo: '未知错误', + errcode: 0, + erralert: false, + }, - subscriptions: { + subscriptions: { setup({ dispatch, history }) { // eslint-disable-line - }, }, + }, - effects: { + effects: { *fetch({ payload }, { call, put }) { // eslint-disable-line - yield put({ type: 'save' }); - }, + yield put({ type: 'save' }); }, + }, - reducers: { - save(state, action) { - return { ...state, ...action.payload, errcode: 1 }; - }, - clear(state, action) { - return { ...state, errinfo: '', errcode: 0 }; - }, + reducers: { + save(state, action) { + return { ...state, ...action.payload, errcode: 1 }; }, + clear(state, action) { + return { ...state, errinfo: '', errcode: 0 }; + }, + }, }; diff --git a/console/src/main/resources/static/src/models/loading.js b/console/src/main/resources/static/src/models/loading.js index 5561ad487..19f71c7d2 100644 --- a/console/src/main/resources/static/src/models/loading.js +++ b/console/src/main/resources/static/src/models/loading.js @@ -14,39 +14,39 @@ export default { - namespace: 'loading', + namespace: 'loading', - state: { - loading: false - }, + state: { + loading: false, + }, - subscriptions: { + subscriptions: { setup({ dispatch, history }) { // eslint-disable-line - }, }, + }, - effects: { + effects: { - *open({ payload }, { call, put }) { - try { - yield put({ type: 'save', payload: { loading: true } }); - } catch (e) { - yield put({ type: 'error/save', payload: { errinfo: e.message } }) - } - }, - *close({ payload }, { call, put }) { - try { - yield put({ type: 'save', payload: { loading: false } }); - } catch (e) { - yield put({ type: 'error/save', payload: { errinfo: e.message } }) - } - } + * open({ payload }, { call, put }) { + try { + yield put({ type: 'save', payload: { loading: true } }); + } catch (e) { + yield put({ type: 'error/save', payload: { errinfo: e.message } }); + } }, - - reducers: { - save(state, action) { - return { ...state, ...action.payload }; - } + * close({ payload }, { call, put }) { + try { + yield put({ type: 'save', payload: { loading: false } }); + } catch (e) { + yield put({ type: 'error/save', payload: { errinfo: e.message } }); + } }, + }, + + reducers: { + save(state, action) { + return { ...state, ...action.payload }; + }, + }, }; diff --git a/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigDetail/ConfigDetail.js b/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigDetail/ConfigDetail.js index d82897c41..4e13595db 100644 --- a/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigDetail/ConfigDetail.js +++ b/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigDetail/ConfigDetail.js @@ -15,185 +15,243 @@ import React from 'react'; import './index.less'; import { getParams, request, aliwareIntl } from '../../../globalLib'; import { Button, Dialog, Field, Form, Input, Loading, Tab } from '@alifd/next'; + const TabPane = Tab.Item; const FormItem = Form.Item; -/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/ class ConfigDetail extends React.Component { - constructor(props) { - super(props); - this.state = { - loading: false, - showmore: false, - activeKey: 'normal', - hasbeta: false, - ips: '', - checkedBeta: false, - switchEncrypt: false, - tag: [{ title: aliwareIntl.get('com.alibaba.nacos.page.configdetail.official'), key: 'normal' }] - }; - this.field = new Field(this); - this.dataId = getParams('dataId') || 'yanlin'; - this.group = getParams('group') || 'DEFAULT_GROUP'; - this.ips = ''; - this.valueMap = {}; //存储不同版本的数据 - this.tenant = getParams('namespace') || ''; - this.searchDataId = getParams('searchDataId') || ''; - this.searchGroup = getParams('searchGroup') || ''; - //this.params = window.location.hash.split('?')[1]||''; - } + constructor(props) { + super(props); + this.state = { + loading: false, + showmore: false, + activeKey: 'normal', + hasbeta: false, + ips: '', + checkedBeta: false, + switchEncrypt: false, + tag: [ + { title: aliwareIntl.get('com.alibaba.nacos.page.configdetail.official'), key: 'normal' }, + ], + }; + this.field = new Field(this); + this.dataId = getParams('dataId') || 'yanlin'; + this.group = getParams('group') || 'DEFAULT_GROUP'; + this.ips = ''; + this.valueMap = {}; // 存储不同版本的数据 + this.tenant = getParams('namespace') || ''; + this.searchDataId = getParams('searchDataId') || ''; + this.searchGroup = getParams('searchGroup') || ''; + // this.params = window.location.hash.split('?')[1]||''; + } - componentDidMount() { - if (this.dataId.startsWith("cipher-")) { - this.setState({ - switchEncrypt: true - }); + componentDidMount() { + if (this.dataId.startsWith('cipher-')) { + this.setState({ + switchEncrypt: true, + }); + } + this.getDataDetail(); + } + + openLoading() { + this.setState({ + loading: true, + }); + } + + closeLoading() { + this.setState({ + loading: false, + }); + } + + changeTab(value) { + const self = this; + const key = value.split('-')[0]; + const data = this.valueMap[key]; + this.setState({ + activeKey: value, + }); + + self.field.setValue('content', data.content); + + if (data.betaIps) { + self.setState({ + ips: data.betaIps, + }); + } + } + + toggleMore() { + this.setState({ + showmore: !this.state.showmore, + }); + } + + getDataDetail() { + const self = this; + this.serverId = getParams('serverId') || 'center'; + this.tenant = getParams('namespace') || ''; + this.edasAppName = getParams('edasAppName') || ''; + this.inApp = this.edasAppName; + const url = `/nacos/v1/cs/configs?show=all&dataId=${this.dataId}&group=${this.group}`; + request({ + url, + beforeSend() { + self.openLoading(); + }, + success(result) { + if (result != null) { + const data = result; + self.valueMap.normal = data; + self.field.setValue('dataId', data.dataId); + self.field.setValue('content', data.content); + self.field.setValue('appName', self.inApp ? self.edasAppName : data.appName); + self.field.setValue('envs', self.serverId); + self.field.setValue('group', data.group); + self.field.setValue('config_tags', data.configTags); + self.field.setValue('desc', data.desc); + self.field.setValue('md5', data.md5); + } else { + Dialog.alert({ + title: aliwareIntl.get('com.alibaba.nacos.page.configdetail.error'), + content: result.message, + language: aliwareIntl.currentLanguageCode, + }); } - this.getDataDetail(); - } - openLoading() { - this.setState({ - loading: true - }); - } - closeLoading() { - this.setState({ - loading: false - }); - } + }, + complete() { + self.closeLoading(); + }, + }); + } - changeTab(value) { + goList() { + this.props.history.push( + `/configurationManagement?serverId=${this.serverId}&group=${this.searchGroup}&dataId=${ + this.searchDataId + }&namespace=${this.tenant}` + ); + } - let self = this; - let key = value.split('-')[0]; - let data = this.valueMap[key]; - console.log(data); - this.setState({ - activeKey: value - }); - - self.field.setValue('content', data.content); - - if (data.betaIps) { - self.setState({ - ips: data.betaIps - }); - } - } - toggleMore() { - this.setState({ - showmore: !this.state.showmore - }); - } - - getDataDetail() { - let self = this; - this.serverId = getParams('serverId') || 'center'; - this.tenant = getParams('namespace') || ''; - this.edasAppName = getParams('edasAppName') || ''; - this.inApp = this.edasAppName; - let url = `/nacos/v1/cs/configs?show=all&dataId=${this.dataId}&group=${this.group}`; - request({ - url: url, - beforeSend: function () { - self.openLoading(); - }, - success: function (result) { - if (result != null) { - let data = result; - self.valueMap['normal'] = data; - self.field.setValue('dataId', data.dataId); - self.field.setValue('content', data.content); - self.field.setValue('appName', self.inApp ? self.edasAppName : data.appName); - self.field.setValue('envs', self.serverId); - self.field.setValue('group', data.group); - self.field.setValue('config_tags', data.configTags); - self.field.setValue('desc', data.desc); - self.field.setValue('md5', data.md5); - } else { - Dialog.alert({ - title: aliwareIntl.get('com.alibaba.nacos.page.configdetail.error'), - content: result.message, - language: aliwareIntl.currentLanguageCode - }); - } - }, - complete: function () { - self.closeLoading(); - } - }); - } - goList() { - this.props.history.push(`/configurationManagement?serverId=${this.serverId}&group=${this.searchGroup}&dataId=${this.searchDataId}&namespace=${this.tenant}`); - } - render() { - const init = this.field.init; - const formItemLayout = { - labelCol: { - span: 2 - }, - wrapperCol: { - span: 22 - } - }; - let activeKey = this.state.activeKey.split('-')[0]; - return ( -
    - -

    {aliwareIntl.get('com.alibaba.nacos.page.configdetail.configuration_details')}

    - {this.state.hasbeta ?
    - - - {this.state.tag.map(tab => )} - - -
    : ''} -
    - - - - - - - - - {this.state.showmore ?
    - - - - - - - -
    : ''} - - - - - {activeKey === 'normal' ? '' : - -
    - -
    -
    } - - - - - - - - - - - -
    -
    + render() { + const { init } = this.field; + const formItemLayout = { + labelCol: { + span: 2, + }, + wrapperCol: { + span: 22, + }, + }; + const activeKey = this.state.activeKey.split('-')[0]; + return ( +
    + +

    + {aliwareIntl.get('com.alibaba.nacos.page.configdetail.configuration_details')} +

    + {this.state.hasbeta ? ( +
    + + {this.state.tag.map(tab => ( + + ))} +
    - ); - } + ) : ( + '' + )} +
    + + + + + + + + {this.state.showmore ? ( +
    + + + + + + + +
    + ) : ( + '' + )} + + + + + {activeKey === 'normal' ? ( + '' + ) : ( + +
    + +
    +
    + )} + + + + + + + + + +
    +
    +
    + ); + } } -/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/ -export default ConfigDetail; \ No newline at end of file + +export default ConfigDetail; diff --git a/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigDetail/index.js b/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigDetail/index.js index 04cd1588d..d468d92ce 100644 --- a/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigDetail/index.js +++ b/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigDetail/index.js @@ -13,4 +13,4 @@ import ConfigDetail from './ConfigDetail'; -export default ConfigDetail; \ No newline at end of file +export default ConfigDetail; diff --git a/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigEditor/ConfigEditor.js b/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigEditor/ConfigEditor.js index a03fdaf08..cedc3ee3f 100644 --- a/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigEditor/ConfigEditor.js +++ b/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigEditor/ConfigEditor.js @@ -17,591 +17,762 @@ import { getParams, request, aliwareIntl } from '../../../globalLib'; import DiffEditorDialog from '../../../components/DiffEditorDialog'; import SuccessDialog from '../../../components/SuccessDialog'; import './index.less'; -import { Balloon, Button, Dialog, Field, Form, Icon, Input, Loading, Radio, Select, Tab, Message } from '@alifd/next'; +import { + Balloon, + Button, + Dialog, + Field, + Form, + Icon, + Input, + Loading, + Radio, + Select, + Tab, + Message, +} from '@alifd/next'; + const TabPane = Tab.Item; const FormItem = Form.Item; const { Group: RadioGroup } = Radio; -/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/ class ConfigEditor extends React.Component { - constructor(props) { - super(props); - this.edasAppName = getParams('edasAppName') || ''; - this.edasAppId = getParams('edasAppId') || ''; - this.inApp = this.edasAppName; - this.field = new Field(this); - this.dataId = getParams('dataId') || 'yanlin'; - this.group = getParams('group') || 'DEFAULT_GROUP'; - this.tenant = getParams('namespace') | ''; - this.state = { - configType: 'text', - codeValue: ``, - envname: 'center', - targetEnvName: '', - envlist: [], - envvalues: [], - loading: false, - showmore: false, - activeKey: 'normal', - hasbeta: false, - ips: '', - checkedBeta: false, - tagLst: [], - config_tags: [], - switchEncrypt: false, - tag: [{ title: aliwareIntl.get('com.alibaba.nacos.page.configeditor.official'), key: 'normal' }] - }; - this.codeValue = ''; - this.mode = 'text'; - this.ips = ''; - this.valueMap = {}; //存储不同版本的数据 - this.searchDataId = getParams('searchDataId') || ''; - this.searchGroup = getParams('searchGroup') || ''; - } - componentDidMount() { - if (this.dataId.startsWith("cipher-")) { - this.setState({ - switchEncrypt: true - }); - } - this.betaips = document.getElementById('betaips'); - this.getDataDetail(); - this.chontenttab = document.getElementById('chontenttab'); //diff标签 + constructor(props) { + super(props); + this.edasAppName = getParams('edasAppName') || ''; + this.edasAppId = getParams('edasAppId') || ''; + this.inApp = this.edasAppName; + this.field = new Field(this); + this.dataId = getParams('dataId') || 'yanlin'; + this.group = getParams('group') || 'DEFAULT_GROUP'; + this.tenant = getParams('namespace') || ''; + this.state = { + configType: 'text', + codeValue: '', + envname: 'center', + targetEnvName: '', + envlist: [], + envvalues: [], + loading: false, + showmore: false, + activeKey: 'normal', + hasbeta: false, + ips: '', + checkedBeta: false, + tagLst: [], + config_tags: [], + switchEncrypt: false, + tag: [ + { title: aliwareIntl.get('com.alibaba.nacos.page.configeditor.official'), key: 'normal' }, + ], + }; + this.codeValue = ''; + this.mode = 'text'; + this.ips = ''; + this.valueMap = {}; // 存储不同版本的数据 + this.searchDataId = getParams('searchDataId') || ''; + this.searchGroup = getParams('searchGroup') || ''; + } + componentDidMount() { + if (this.dataId.startsWith('cipher-')) { + this.setState({ + switchEncrypt: true, + }); } + this.betaips = document.getElementById('betaips'); + this.getDataDetail(); + this.chontenttab = document.getElementById('chontenttab'); // diff标签 + } - initMoacoEditor(language, value) { - if (!window.monaco) { - window.importEditor(() => { - this.monacoEditor = window.monaco.editor.create(document.getElementById('container'), { - value: value, - language: this.state.configType, - codeLens: true, - selectOnLineNumbers: true, - roundedSelection: false, - readOnly: false, - lineNumbersMinChars: true, - theme: 'vs-dark', - wordWrapColumn: 120, - folding: true, - showFoldingControls: 'always', - wordWrap: 'wordWrapColumn', - cursorStyle: 'line', - automaticLayout: true - }); - }); + initMoacoEditor(language, value) { + if (!window.monaco) { + window.importEditor(() => { + this.monacoEditor = window.monaco.editor.create(document.getElementById('container'), { + value, + language: this.state.configType, + codeLens: true, + selectOnLineNumbers: true, + roundedSelection: false, + readOnly: false, + lineNumbersMinChars: true, + theme: 'vs-dark', + wordWrapColumn: 120, + folding: true, + showFoldingControls: 'always', + wordWrap: 'wordWrapColumn', + cursorStyle: 'line', + automaticLayout: true, + }); + }); + } else { + this.monacoEditor = window.monaco.editor.create(document.getElementById('container'), { + value, + language: this.state.configType, + codeLens: true, + selectOnLineNumbers: true, + roundedSelection: false, + readOnly: false, + lineNumbersMinChars: true, + theme: 'vs-dark', + wordWrapColumn: 120, + folding: true, + showFoldingControls: 'always', + wordWrap: 'wordWrapColumn', + cursorStyle: 'line', + automaticLayout: true, + }); + } + } + + toggleMore() { + this.setState({ + showmore: !this.state.showmore, + }); + } + + navTo(url) { + this.serverId = getParams('serverId') || ''; + this.tenant = getParams('namespace') || ''; // 为当前实例保存tenant参数 + this.props.history.push( + `${url}?serverId=${this.serverId || ''}&dataId=${this.dataId}&group=${this.group}&namespace=${ + this.tenant + }` + ); + } + + openLoading() { + this.setState({ + loading: true, + }); + } + + closeLoading() { + this.setState({ + loading: false, + }); + } + + getDataDetail() { + const self = this; + this.tenant = getParams('namespace') || ''; + this.serverId = getParams('serverId') || 'center'; + const url = `/nacos/v1/cs/configs?show=all&dataId=${this.dataId}&group=${this.group}`; + request({ + url, + beforeSend() { + self.openLoading(); + }, + success(result) { + if (result != null) { + const data = result; + self.valueMap.normal = data; + self.field.setValue('dataId', data.dataId); + // self.field.setValue('content', data.content); + self.field.setValue('appName', self.inApp ? self.edasAppName : data.appName); + // self.field.setValue('envs', self.serverId); + self.field.setValue('group', data.group); + + // self.field.setValue('type', data.type); + self.field.setValue('desc', data.desc); + // self.field.setValue('md5', data.md5); + self.codeValue = data.content || ''; + const type = data.type || 'text'; + self.setState({ + // 设置radio 高亮 + configType: type, + }); + self.initMoacoEditor(type, self.codeValue); + + // self.createCodeMirror('text', self.codeValue); + // self.codeValue = self.commoneditor.doc.getValue(); + if (data.configTags != null) { + const tagArr = data.configTags.split(','); + self.setConfigTags(tagArr); + } + + const envvalues = []; + const env = {}; + self.serverId = env.serverId; + self.targetEnvs = envvalues; } else { - this.monacoEditor = window.monaco.editor.create(document.getElementById('container'), { - value: value, - language: this.state.configType, - codeLens: true, - selectOnLineNumbers: true, - roundedSelection: false, - readOnly: false, - lineNumbersMinChars: true, - theme: 'vs-dark', - wordWrapColumn: 120, - folding: true, - showFoldingControls: 'always', - wordWrap: 'wordWrapColumn', - cursorStyle: 'line', - automaticLayout: true - }); + Dialog.alert({ + language: aliwareIntl.currentLanguageCode || 'zh-cn', + title: aliwareIntl.get('com.alibaba.nacos.page.configeditor.wrong'), + content: result.message, + }); } - } + }, + complete() { + self.closeLoading(); + }, + }); + } - toggleMore() { - this.setState({ - showmore: !this.state.showmore + goList() { + const tenant = getParams('namespace'); + this.props.history.push( + `/configurationManagement?serverId=${this.serverId}&group=${this.searchGroup}&dataId=${ + this.searchDataId + }&namespace=${tenant}` + ); + } + + createCodeMirror(mode, value) { + const commontarget = this.refs.commoneditor; + commontarget.innerHTML = ''; + this.commoneditor = window.CodeMirror(commontarget, { + value, + mode, + lineNumbers: true, + theme: 'xq-light', + lint: true, + gutters: ['CodeMirror-lint-markers'], + extraKeys: { + F1(cm) { + cm.setOption('fullScreen', !cm.getOption('fullScreen')); + }, + Esc(cm) { + if (cm.getOption('fullScreen')) cm.setOption('fullScreen', false); + }, + }, + }); + this.commoneditor.on('change', this.codemirrorValueChanged.bind(this)); + } + + codemirrorValueChanged(doc) { + if (this.diffeditor) { + this.diffeditor.edit.doc.setValue(doc.getValue()); + } + } + + createDiffCodeMirror(leftCode, rightCode) { + const target = this.refs.diffeditor; + target.innerHTML = ''; + + this.diffeditor = window.CodeMirror.MergeView(target, { + value: leftCode || '', + origLeft: null, + orig: rightCode || '', + lineNumbers: true, + mode: this.mode, + theme: 'xq-light', + highlightDifferences: true, + connect: 'align', + collapseIdentical: false, + }); + } + + changeConfig(value) { + if (value === 0) { + this.createCodeMirror('text', this.codeValue); + this.mode = 'text'; + } + if (value === 1) { + this.createCodeMirror('application/json', this.codeValue); + this.mode = 'application/json'; + } + if (value === 2) { + this.createCodeMirror('xml', this.codeValue); + this.mode = 'xml'; + } + this.setState({ + configType: value, + }); + } + + setCodeValue(value) { + this.setState({ + codeValue: value, + }); + } + + toggleDiff(checked) { + if (checked) { + this.chontenttab.style.display = 'block'; + + const nowvalue = this.commoneditor.doc.getValue(); + if (!this.diffeditor) { + this.createDiffCodeMirror(nowvalue, this.codeValue); + } + } else { + this.chontenttab.style.display = 'none'; + // this.diffeditor = null; + // let target = this.refs["diffeditor"]; + // target.innerHTML = ''; + } + } + + publishConfig() { + this.field.validate((errors, values) => { + if (errors) { + return; + } + let content = ''; + const self = this; + // if (this.commoneditor) { + // content = this.commoneditor.doc.getValue(); + // //content = content.replace("↵", "\n\r"); + // } else { + // content = this.codeValue; + // } + + if (this.monacoEditor) { + content = this.monacoEditor.getValue(); + } else { + content = this.codeValue; + } + if (!content) { + Message.error({ + content: aliwareIntl.get('nacos.page.ConfigEditor.submit_failed'), + align: 'cc cc', }); - } - navTo(url) { + return; + } + this.codeValue = content; + this.tenant = getParams('namespace') || ''; + this.serverId = getParams('serverId') || 'center'; - this.serverId = getParams('serverId') || ''; - this.tenant = getParams('namespace') || ''; //为当前实例保存tenant参数 - this.props.history.push(`${url}?serverId=${this.serverId || ''}&dataId=${this.dataId}&group=${this.group}&namespace=${this.tenant}`); - } + const payload = { + dataId: this.field.getValue('dataId'), + appName: this.inApp ? this.edasAppId : this.field.getValue('appName'), + group: this.field.getValue('group'), + desc: this.field.getValue('desc'), + config_tags: this.state.config_tags.join(), + type: this.state.configType, + content, + tenant: this.tenant, + }; + const url = '/nacos/v1/cs/configs'; + request({ + type: 'post', + contentType: 'application/x-www-form-urlencoded', + url, + data: payload, + success(res) { + const _payload = {}; + _payload.maintitle = aliwareIntl.get('com.alibaba.nacos.page.configeditor.toedittitle'); + _payload.title = ( +
    {aliwareIntl.get('com.alibaba.nacos.page.configeditor.toedit')}
    + ); + _payload.content = ''; + _payload.dataId = payload.dataId; + _payload.group = payload.group; - openLoading() { - this.setState({ - loading: true - }); - } - closeLoading() { - this.setState({ - loading: false - }); - } - getDataDetail() { - let self = this; - this.tenant = getParams('namespace') || ''; - this.serverId = getParams('serverId') || 'center'; - let url = `/nacos/v1/cs/configs?show=all&dataId=${this.dataId}&group=${this.group}`; - request({ - url: url, - beforeSend: function () { - self.openLoading(); - }, - success: function (result) { - - if (result != null) { - let data = result; - self.valueMap['normal'] = data; - self.field.setValue('dataId', data.dataId); - //self.field.setValue('content', data.content); - self.field.setValue('appName', self.inApp ? self.edasAppName : data.appName); - //self.field.setValue('envs', self.serverId); - self.field.setValue('group', data.group); - - //self.field.setValue('type', data.type); - self.field.setValue('desc', data.desc); - //self.field.setValue('md5', data.md5); - self.codeValue = data.content || ''; - let type = data.type || 'text'; - self.setState({ //设置radio 高亮 - configType: type - }); - self.initMoacoEditor(type, self.codeValue); - - //self.createCodeMirror('text', self.codeValue); - //self.codeValue = self.commoneditor.doc.getValue(); - if (data.configTags != null) { - let tagArr = data.configTags.split(","); - self.setConfigTags(tagArr); - } - - let envvalues = []; - let env = {}; - self.serverId = env.serverId; - self.targetEnvs = envvalues; - } else { - Dialog.alert({ - language: aliwareIntl.currentLanguageCode || 'zh-cn', - title: aliwareIntl.get('com.alibaba.nacos.page.configeditor.wrong'), - content: result.message - }); - } - }, - complete: function () { - self.closeLoading(); + if (res != null) { + _payload.isok = true; + const activeKey = self.state.activeKey.split('-')[0]; + if (activeKey === 'normal' && self.hasips === true) { + // 如果是在normal面板选择了beta发布 + const sufex = new Date().getTime(); + self.setState({ + tag: [ + { + title: aliwareIntl.get('com.alibaba.nacos.page.configeditor.official'), + key: `normal-${sufex}`, + }, + { title: 'BETA', key: `beta-${sufex}` }, + ], + hasbeta: true, + activeKey: `beta-${sufex}`, + }); + payload.betaIps = payload.betaIps || payload.ips; + self.valueMap.beta = payload; // 赋值beta + self.changeTab(`beta-${sufex}`); } - }); - } - goList() { - - let tenant = getParams('namespace'); - this.props.history.push(`/configurationManagement?serverId=${this.serverId}&group=${this.searchGroup}&dataId=${this.searchDataId}&namespace=${tenant}`); - } - - createCodeMirror(mode, value) { - let commontarget = this.refs["commoneditor"]; - commontarget.innerHTML = ''; - this.commoneditor = window.CodeMirror(commontarget, { - value: value, - mode: mode, - lineNumbers: true, - theme: 'xq-light', - lint: true, - gutters: ["CodeMirror-lint-markers"], - extraKeys: { - "F1": function (cm) { - cm.setOption("fullScreen", !cm.getOption("fullScreen")); - }, - "Esc": function (cm) { - if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false); - } + if (activeKey === 'normal' && self.hasips === false) { + // 如果是在normal面板选择了发布 + self.valueMap.normal = payload; // 赋值正式 } - }); - this.commoneditor.on('change', this.codemirrorValueChanged.bind(this)); - } - codemirrorValueChanged(doc) { - if (this.diffeditor) { - this.diffeditor.edit.doc.setValue(doc.getValue()); - } - } - createDiffCodeMirror(leftCode, rightCode) { - let target = this.refs["diffeditor"]; - target.innerHTML = ''; - - this.diffeditor = window.CodeMirror.MergeView(target, { - value: leftCode || '', - origLeft: null, - orig: rightCode || '', - lineNumbers: true, - mode: this.mode, - theme: 'xq-light', - highlightDifferences: true, - connect: 'align', - collapseIdentical: false - }); - } - changeConfig(value) { - if (value === 0) { - this.createCodeMirror('text', this.codeValue); - this.mode = 'text'; - } - if (value === 1) { - this.createCodeMirror('application/json', this.codeValue); - this.mode = 'application/json'; - } - if (value === 2) { - this.createCodeMirror('xml', this.codeValue); - this.mode = 'xml'; - } - this.setState({ - configType: value - }); - } - setCodeValue(value) { - - this.setState({ - codeValue: value - }); - } - toggleDiff(checked) { - if (checked) { - this.chontenttab.style.display = 'block'; - - let nowvalue = this.commoneditor.doc.getValue(); - if (!this.diffeditor) { - this.createDiffCodeMirror(nowvalue, this.codeValue); + if (activeKey === 'beta' && self.hasips === true) { + // 如果是在beta面板继续beta发布 + self.valueMap.beta = payload; // 赋值beta } - } else { - this.chontenttab.style.display = 'none'; - //this.diffeditor = null; - //let target = this.refs["diffeditor"]; - //target.innerHTML = ''; + } else { + _payload.isok = false; + _payload.message = res.message; + } + self.refs.success.openDialog(_payload); + }, + error() {}, + }); + }); + } + + validateChart(rule, value, callback) { + const chartReg = /[@#\$%\^&\*]+/g; + + if (chartReg.test(value)) { + callback(aliwareIntl.get('com.alibaba.nacos.page.configeditor.vdchart')); + } else { + callback(); + } + } + + changeEnv(values) { + this.targetEnvs = values; + this.setState({ + envvalues: values, + }); + } + + changeBeta(selected) { + if (selected) { + this.betaips.style.display = 'block'; + } else { + this.betaips.style.display = 'none'; + } + this.setState({ + checkedBeta: selected, + }); + } + + getIps(value) { + this.ips = value; + this.setState({ + ips: value, + }); + } + + setConfigTags(value) { + if (value.length > 5) { + value.pop(); + } + value.forEach((v, i) => { + if (v.indexOf(',') !== -1 || v.indexOf('=') !== -1) { + value.splice(i, 1); + } + }); + this.setState({ + config_tags: value, + }); + } + + onInputUpdate(value) { + if (this.inputtimmer) { + clearTimeout(this.inputtimmer); + } + this.inputtimmer = setTimeout(() => { + const { tagLst } = this.state; + + let hastag = false; + tagLst.forEach((v, i) => { + if (v.value === value) { + hastag = true; } - } - publishConfig() { - this.field.validate((errors, values) => { - if (errors) { - return; - } - let content = ''; - let self = this; - // if (this.commoneditor) { - // content = this.commoneditor.doc.getValue(); - // //content = content.replace("↵", "\n\r"); - // } else { - // content = this.codeValue; - // } - - if (this.monacoEditor) { - content = this.monacoEditor.getValue(); - } else { - content = this.codeValue; - } - if (!content) { - Message.error({ - content: aliwareIntl.get("nacos.page.ConfigEditor.submit_failed"), - align: "cc cc" - }); - return; - } - this.codeValue = content; - this.tenant = getParams('namespace') || ''; - this.serverId = getParams('serverId') || 'center'; - - let payload = { - dataId: this.field.getValue('dataId'), - appName: this.inApp ? this.edasAppId : this.field.getValue('appName'), - group: this.field.getValue('group'), - desc: this.field.getValue('desc'), - config_tags: this.state.config_tags.join(), - type: this.state.configType, - content: content, - tenant: this.tenant - - }; - let url = `/nacos/v1/cs/configs`; - request({ - type: 'post', - contentType: 'application/x-www-form-urlencoded', - url: url, - data: payload, - success: function (res) { - let _payload = {}; - _payload.maintitle = aliwareIntl.get('com.alibaba.nacos.page.configeditor.toedittitle'); - _payload.title =
    {aliwareIntl.get('com.alibaba.nacos.page.configeditor.toedit')}
    ; - _payload.content = ''; - _payload.dataId = payload.dataId; - _payload.group = payload.group; - - if (res != null) { - _payload.isok = true; - let activeKey = self.state.activeKey.split('-')[0]; - if (activeKey === 'normal' && self.hasips === true) { - //如果是在normal面板选择了beta发布 - let sufex = new Date().getTime(); - self.setState({ - tag: [{ title: aliwareIntl.get('com.alibaba.nacos.page.configeditor.official'), key: `normal-${sufex}` }, { title: 'BETA', key: `beta-${sufex}` }], hasbeta: true, - activeKey: `beta-${sufex}` - }); - payload.betaIps = payload.betaIps || payload.ips; - self.valueMap['beta'] = payload; //赋值beta - self.changeTab(`beta-${sufex}`); - } - if (activeKey === 'normal' && self.hasips === false) { - //如果是在normal面板选择了发布 - self.valueMap['normal'] = payload; //赋值正式 - } - if (activeKey === 'beta' && self.hasips === true) { - //如果是在beta面板继续beta发布 - self.valueMap['beta'] = payload; //赋值beta - } - } else { - _payload.isok = false; - _payload.message = res.message; - } - self.refs['success'].openDialog(_payload - ); - }, - error: function () { } - }); + }); + if (!hastag) { + tagLst.push({ + value, + label: value, + time: Math.random(), }); + } + this.setState({ tagLst }); + }, 500); + } + + openDiff(hasips) { + this.hasips = hasips; // 是否包含ips + let leftvalue = this.monacoEditor.getValue(); // this.commoneditor.doc.getValue(); + let rightvalue = this.codeValue; + leftvalue = leftvalue.replace(/\r\n/g, '\n').replace(/\n/g, '\r\n'); + rightvalue = rightvalue.replace(/\r\n/g, '\n').replace(/\n/g, '\r\n'); + // let rightvalue = this.diffeditor.doc.getValue(); + // console.log(this.commoneditor, leftvalue==rightvalue) + this.refs.diffeditor.openDialog(leftvalue, rightvalue); + } + + changeTab(value) { + const self = this; + const key = value.split('-')[0]; + + const data = this.valueMap[key]; + this.setState({ + activeKey: value, + }); + self.field.setValue('dataId', data.dataId); + + self.field.setValue('appName', self.inApp ? self.edasAppName : data.appName); + // self.field.setValue('envs', self.serverId); + self.field.setValue('group', data.group); + // self.field.setValue('md5', data.md5); + self.codeValue = data.content || ''; + self.createCodeMirror('text', self.codeValue); + if (data.betaIps) { + self.getIps(data.betaIps); + self.changeBeta(true); + } else { + self.getIps(''); + self.changeBeta(false); } - validateChart(rule, value, callback) { - const chartReg = /[@#\$%\^&\*]+/g; + } - if (chartReg.test(value)) { - callback(aliwareIntl.get('com.alibaba.nacos.page.configeditor.vdchart')); - } else { - callback(); - } + newChangeConfig(value) { + this.setState({ + configType: value, + }); + this.changeModel(value); + } + + changeModel(type, value) { + if (!this.monacoEditor) { + $('#container').empty(); + this.initMoacoEditor(type, value); + return; } - - changeEnv(values) { - this.targetEnvs = values; - this.setState({ - envvalues: values - }); + const oldModel = this.monacoEditor.getModel(); + const oldValue = this.monacoEditor.getValue(); + const newModel = window.monaco.editor.createModel(oldValue, type); + this.monacoEditor.setModel(newModel); + if (oldModel) { + oldModel.dispose(); } - changeBeta(selected) { - if (selected) { - this.betaips.style.display = 'block'; - } else { - this.betaips.style.display = 'none'; - } - this.setState({ - checkedBeta: selected - }); - } - getIps(value) { - this.ips = value; - this.setState({ - ips: value - }); - } - setConfigTags(value) { - if (value.length > 5) { - value.pop(); - } - value.forEach((v, i) => { - if (v.indexOf(',') !== -1 || v.indexOf('=') !== -1) { - value.splice(i, 1); - } - }); - this.setState({ - config_tags: value - }); - } - onInputUpdate(value) { - if (this.inputtimmer) { - clearTimeout(this.inputtimmer); - } - this.inputtimmer = setTimeout(() => { - let tagLst = this.state.tagLst, - hastag = false; - tagLst.forEach((v, i) => { - if (v.value === value) { - hastag = true; - } - }); - if (!hastag) { - tagLst.push({ - value: value, - label: value, - time: Math.random() - }); - } - this.setState({ tagLst: tagLst }); - }, 500); - } - openDiff(hasips) { - this.hasips = hasips; //是否包含ips - let leftvalue = this.monacoEditor.getValue(); //this.commoneditor.doc.getValue(); - let rightvalue = this.codeValue; - leftvalue = leftvalue.replace(/\r\n/g, "\n").replace(/\n/g, "\r\n"); - rightvalue = rightvalue.replace(/\r\n/g, "\n").replace(/\n/g, "\r\n"); - //let rightvalue = this.diffeditor.doc.getValue(); - //console.log(this.commoneditor, leftvalue==rightvalue) - this.refs['diffeditor'].openDialog(leftvalue, rightvalue); - } - changeTab(value) { + } - let self = this; - let key = value.split('-')[0]; + render() { + const { init } = this.field; + const formItemLayout = { + labelCol: { + span: 2, + }, + wrapperCol: { + span: 22, + }, + }; - let data = this.valueMap[key]; - this.setState({ - activeKey: value - }); - self.field.setValue('dataId', data.dataId); + // const list = [{ + // value: 0, + // label: 'TEXT' + // }, { + // value: 1, + // label: 'JSON' + // }, { + // value: 2, + // label: 'XML' + // }]; + const list = [ + { + value: 'text', + label: 'TEXT', + }, + { + value: 'json', + label: 'JSON', + }, + { + value: 'xml', + label: 'XML', + }, + { + value: 'yaml', + label: 'YAML', + }, + { + value: 'html', + label: 'HTML', + }, + { + value: 'properties', + label: 'Properties', + }, + ]; + const activeKey = this.state.activeKey.split('-')[0]; - self.field.setValue('appName', self.inApp ? self.edasAppName : data.appName); - //self.field.setValue('envs', self.serverId); - self.field.setValue('group', data.group); - //self.field.setValue('md5', data.md5); - self.codeValue = data.content || ''; - self.createCodeMirror('text', self.codeValue); - if (data.betaIps) { - self.getIps(data.betaIps); - self.changeBeta(true); - } else { - self.getIps(''); - self.changeBeta(false); - } - } - newChangeConfig(value) { - this.setState({ - configType: value - }); - this.changeModel(value); - } - changeModel(type, value) { - if (!this.monacoEditor) { - $('#container').empty(); - this.initMoacoEditor(type, value); - return; - } - let oldModel = this.monacoEditor.getModel(); - let oldValue = this.monacoEditor.getValue(); - let newModel = window.monaco.editor.createModel(oldValue, type); - this.monacoEditor.setModel(newModel); - if (oldModel) { - oldModel.dispose(); - } - } - render() { - const { init } = this.field; - const formItemLayout = { - labelCol: { - span: 2 - }, - wrapperCol: { - span: 22 - } - }; - - // const list = [{ - // value: 0, - // label: 'TEXT' - // }, { - // value: 1, - // label: 'JSON' - // }, { - // value: 2, - // label: 'XML' - // }]; - const list = [{ - value: 'text', - label: 'TEXT' - }, { - value: 'json', - label: 'JSON' - }, { - value: 'xml', - label: 'XML' - }, { - value: 'yaml', - label: 'YAML' - }, { - value: 'html', - label: 'HTML' - }, { - value: 'properties', - label: 'Properties' - }]; - let activeKey = this.state.activeKey.split('-')[0]; - - return ( -
    - -

    -
    {aliwareIntl.get('com.alibaba.nacos.page.configeditor.toedit')}
    - -

    - {this.state.hasbeta ?
    - - - {this.state.tag.map(tab => )} - - -
    : ''} - -
    - - - - - - - - - - -
    - - - - - - - - -
    - - - - - - - - {aliwareIntl.get('com.alibaba.nacos.page.configeditor.configcontent')}} align="t" style={{ marginRight: 5 }} triggerType="hover"> -

    {aliwareIntl.get('com.alibaba.nacos.page.configeditor.Esc_exit')}

    -

    {aliwareIntl.get('com.alibaba.nacos.page.configeditor.release_beta')}

    -
    :} {...formItemLayout}> -
    -
    - -
    - {activeKey === 'beta' ? : ''} - {activeKey === 'normal' ? : } - - -
    -
    -
    - - -
    + return ( +
    + +

    +
    {aliwareIntl.get('com.alibaba.nacos.page.configeditor.toedit')}
    +

    + {this.state.hasbeta ? ( +
    + + {this.state.tag.map(tab => ( + + ))} +
    - ); - } + ) : ( + '' + )} + +
    + + + + + + + + + +
    + + + +
    + + + + + + + + + {aliwareIntl.get('com.alibaba.nacos.page.configeditor.configcontent')} + + } + align="t" + style={{ marginRight: 5 }} + triggerType="hover" + > +

    {aliwareIntl.get('com.alibaba.nacos.page.configeditor.Esc_exit')}

    +

    {aliwareIntl.get('com.alibaba.nacos.page.configeditor.release_beta')}

    +
    + : + + } + {...formItemLayout} + > +
    + + +
    + {activeKey === 'beta' ? ( + + ) : ( + '' + )} + {activeKey === 'normal' ? ( + + ) : ( + + )} + + +
    +
    + + + + +
    + ); + } } -/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/ -export default ConfigEditor; \ No newline at end of file + +export default ConfigEditor; diff --git a/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigRollback/ConfigRollback.js b/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigRollback/ConfigRollback.js index fa8be1ae6..4ddb9a0f3 100644 --- a/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigRollback/ConfigRollback.js +++ b/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigRollback/ConfigRollback.js @@ -15,185 +15,217 @@ import React from 'react'; import './index.less'; import { getParams, request, aliwareIntl } from '../../../globalLib'; import { Button, Dialog, Field, Form, Input } from '@alifd/next'; + const FormItem = Form.Item; -/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/ class ConfigRollback extends React.Component { + constructor(props) { + super(props); + this.field = new Field(this); + this.dataId = getParams('dataId') || 'yanlin'; + this.group = getParams('group') || 'DEFAULT_GROUP'; + this.serverId = getParams('serverId') || 'center'; + this.nid = getParams('nid') || ''; + this.state = { + envName: '', + visible: false, + showmore: false, + }; + // this.params = window.location.hash.split('?')[1]||''; + this.typeMap = { + // 操作映射提示 + U: 'publish', + I: aliwareIntl.get('com.alibaba.nacos.page.configRollback.delete'), + D: 'publish', + }; + this.typeMapName = { + // 操作映射名 + U: aliwareIntl.get('com.alibaba.nacos.page.configRollback.updated'), + I: aliwareIntl.get('com.alibaba.nacos.page.configRollback.inserted'), + D: aliwareIntl.get('com.alibaba.nacos.page.configRollback.delete'), + }; + } - constructor(props) { - super(props); - this.field = new Field(this); - this.dataId = getParams('dataId') || 'yanlin'; - this.group = getParams('group') || 'DEFAULT_GROUP'; - this.serverId = getParams('serverId') || 'center'; - this.nid = getParams('nid') || ''; - this.state = { - envName: '', - visible: false, - showmore: false - }; - //this.params = window.location.hash.split('?')[1]||''; - this.typeMap = { //操作映射提示 - 'U': 'publish', - 'I': aliwareIntl.get('com.alibaba.nacos.page.configRollback.delete'), - 'D': 'publish' - }; - this.typeMapName = { //操作映射名 - 'U': aliwareIntl.get('com.alibaba.nacos.page.configRollback.updated'), - 'I': aliwareIntl.get('com.alibaba.nacos.page.configRollback.inserted'), - 'D': aliwareIntl.get('com.alibaba.nacos.page.configRollback.delete') - }; - } + componentDidMount() { + this.getDataDetail(); + } - componentDidMount() { - this.getDataDetail(); - } - toggleMore() { - this.setState({ - showmore: !this.state.showmore - }); - } - getDataDetail() { - let self = this; - this.tenant = getParams('namespace') || ''; - this.serverId = getParams('serverId') || 'center'; - let url = `/nacos/v1/cs/history?dataId=${this.dataId}&group=${this.group}&nid=${this.nid}`; - request({ - url: url, - success: function (result) { - if (result != null) { - let data = result; - let envName = self.serverId; - self.id = data.id; //详情的id - self.field.setValue('dataId', data.dataId); - self.field.setValue('content', data.content); - self.field.setValue('appName', data.appName); - self.field.setValue('opType', self.typeMapName[data.opType.trim()]); - self.opType = data.opType; //当前回滚类型I:插入,D:删除,U:'更新' - self.field.setValue('group', data.group); - self.field.setValue('md5', data.md5); - self.field.setValue('envName', envName); - self.setState({ - envName: envName - }); - } - } - }); - } - goList() { - let tenant = getParams('namespace'); - this.props.history.push(`/historyRollback?serverId=${this.serverId}&group=${this.group}&dataId=${this.dataId}&namespace=${tenant}`); - } + toggleMore() { + this.setState({ + showmore: !this.state.showmore, + }); + } - onOpenConfirm() { - let self = this; - let type = 'post'; - if (this.opType.trim() === 'I') { - type = 'delete'; + getDataDetail() { + const self = this; + this.tenant = getParams('namespace') || ''; + this.serverId = getParams('serverId') || 'center'; + const url = `/nacos/v1/cs/history?dataId=${this.dataId}&group=${this.group}&nid=${this.nid}`; + request({ + url, + success(result) { + if (result != null) { + const data = result; + const envName = self.serverId; + self.id = data.id; // 详情的id + self.field.setValue('dataId', data.dataId); + self.field.setValue('content', data.content); + self.field.setValue('appName', data.appName); + self.field.setValue('opType', self.typeMapName[data.opType.trim()]); + self.opType = data.opType; // 当前回滚类型I:插入,D:删除,U:'更新' + self.field.setValue('group', data.group); + self.field.setValue('md5', data.md5); + self.field.setValue('envName', envName); + self.setState({ + envName, + }); } - Dialog.confirm({ - language: aliwareIntl.currentLanguageCode || 'zh-cn', - title: aliwareIntl.get('com.alibaba.nacos.page.configRollback.please_confirm_rollback'), - content:
    -

    {aliwareIntl.get('com.alibaba.nacos.page.configRollback.determine')} {aliwareIntl.get('com.alibaba.nacos.page.configRollback.the_following_configuration')}

    -

    - Data ID: - - {self.field.getValue("dataId")} - -

    -

    - Group: - - {self.field.getValue("group")} - -

    + }, + }); + } -
    , - onOk: function () { - self.tenant = getParams('namespace') || ''; - self.serverId = getParams('serverId') || 'center'; - self.dataId = self.field.getValue("dataId"); - self.group = self.field.getValue("group"); - let postData = { - appName: self.field.getValue("appName"), - dataId: self.dataId, - group: self.group, - content: self.field.getValue("content"), - tenant: self.tenant - }; + goList() { + const tenant = getParams('namespace'); + this.props.history.push( + `/historyRollback?serverId=${this.serverId}&group=${this.group}&dataId=${ + this.dataId + }&namespace=${tenant}` + ); + } - let url = `/nacos/v1/cs/configs`; - if (self.opType.trim() === 'I') { - url = `/nacos/v1/cs/configs?dataId=${self.dataId}&group=${self.group}`; - postData = {}; - } - - // ajax - request({ - type: type, - contentType: 'application/x-www-form-urlencoded', - url: url, - data: postData, - success: function (data) { - if (data === true) { - Dialog.alert({ language: aliwareIntl.currentLanguageCode || 'zh-cn', content: aliwareIntl.get('com.alibaba.nacos.page.configRollback.rollback_successful') }); - } - } - }); - } - }); + onOpenConfirm() { + const self = this; + let type = 'post'; + if (this.opType.trim() === 'I') { + type = 'delete'; } - - render() { - const init = this.field.init; - const formItemLayout = { - labelCol: { - fixedSpan: 6 - }, - wrapperCol: { - span: 18 - } + Dialog.confirm({ + language: aliwareIntl.currentLanguageCode || 'zh-cn', + title: aliwareIntl.get('com.alibaba.nacos.page.configRollback.please_confirm_rollback'), + content: ( +
    +

    + {aliwareIntl.get('com.alibaba.nacos.page.configRollback.determine')}{' '} + {aliwareIntl.get('com.alibaba.nacos.page.configRollback.the_following_configuration')} +

    +

    + Data ID: + {self.field.getValue('dataId')} +

    +

    + Group: + {self.field.getValue('group')} +

    +
    + ), + onOk() { + self.tenant = getParams('namespace') || ''; + self.serverId = getParams('serverId') || 'center'; + self.dataId = self.field.getValue('dataId'); + self.group = self.field.getValue('group'); + let postData = { + appName: self.field.getValue('appName'), + dataId: self.dataId, + group: self.group, + content: self.field.getValue('content'), + tenant: self.tenant, }; - return ( -
    -

    {aliwareIntl.get('com.alibaba.nacos.page.configRollback.configuration_rollback')}

    -
    - - - - -
    - - - - - - -
    - - - - - - - - - - - - - + let url = '/nacos/v1/cs/configs'; + if (self.opType.trim() === 'I') { + url = `/nacos/v1/cs/configs?dataId=${self.dataId}&group=${self.group}`; + postData = {}; + } -
    + // ajax + request({ + type, + contentType: 'application/x-www-form-urlencoded', + url, + data: postData, + success(data) { + if (data === true) { + Dialog.alert({ + language: aliwareIntl.currentLanguageCode || 'zh-cn', + content: aliwareIntl.get( + 'com.alibaba.nacos.page.configRollback.rollback_successful' + ), + }); + } + }, + }); + }, + }); + } + render() { + const { init } = this.field; + const formItemLayout = { + labelCol: { + fixedSpan: 6, + }, + wrapperCol: { + span: 18, + }, + }; + return ( +
    +

    {aliwareIntl.get('com.alibaba.nacos.page.configRollback.configuration_rollback')}

    +
    + + + - ); - } - + +
    + + + + + + +
    + + + + + + + + + + + + + +
    +
    + ); + } } -/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/ -export default ConfigRollback; \ No newline at end of file + +export default ConfigRollback; diff --git a/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigRollback/index.js b/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigRollback/index.js index 49e94e39e..8ce5122e0 100644 --- a/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigRollback/index.js +++ b/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigRollback/index.js @@ -13,4 +13,4 @@ import ConfigRollback from './ConfigRollback'; -export default ConfigRollback; \ No newline at end of file +export default ConfigRollback; diff --git a/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigSync/ConfigSync.js b/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigSync/ConfigSync.js index 7b9ec3462..6b7dcbc70 100644 --- a/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigSync/ConfigSync.js +++ b/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigSync/ConfigSync.js @@ -17,258 +17,306 @@ import SuccessDialog from '../../../components/SuccessDialog'; import { getParams, request, aliwareIntl } from '../../../globalLib'; import './index.less'; -/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/ class ConfigSync extends React.Component { - constructor(props) { - super(props); - this.field = new Field(this); - this.dataId = getParams('dataId') || 'yanlin'; - this.group = getParams('group') || ''; - this.serverId = getParams('serverId') || ''; + constructor(props) { + super(props); + this.field = new Field(this); + this.dataId = getParams('dataId') || 'yanlin'; + this.group = getParams('group') || ''; + this.serverId = getParams('serverId') || ''; - this.state = { - configType: 0, + this.state = { + configType: 0, - envvalues: [], - commonvalue: [], - envComponent: '', - envGroups: [], - envlist: [], - loading: false, - showmore: false - }; - this.codeValue = ''; - this.mode = 'text'; - this.ips = ''; - } - componentDidMount() { + envvalues: [], + commonvalue: [], + envComponent: '', + envGroups: [], + envlist: [], + loading: false, + showmore: false, + }; + this.codeValue = ''; + this.mode = 'text'; + this.ips = ''; + } - this.getDataDetail(); - // this.getDomain(); - } - toggleMore() { - this.setState({ - showmore: !this.state.showmore - }); - } - getEnvList(value) { - this.setState({ - envvalues: value - }); - this.envs = value; - } - getDomain() { - let self = this; - request({ - url: `/diamond-ops/env/domain`, - success: function (data) { + componentDidMount() { + this.getDataDetail(); + // this.getDomain(); + } - if (data.code === 200) { - let envGroups = data.data.envGroups; + toggleMore() { + this.setState({ + showmore: !this.state.showmore, + }); + } - self.setState({ - envGroups: envGroups - }); - } - } - }); - } - getDataDetail() { - let self = this; - this.tenant = getParams('namespace') || ''; - this.serverId = getParams('serverId') || 'center'; - let url = `/diamond-ops/configList/detail/serverId/${this.serverId}/dataId/${this.dataId}/group/${this.group}/tenant/${this.tenant}?id=`; - if (this.tenant === 'global' || !this.tenant) { - url = `/diamond-ops/configList/detail/serverId/${this.serverId}/dataId/${this.dataId}/group/${this.group}?id=`; + getEnvList(value) { + this.setState({ + envvalues: value, + }); + this.envs = value; + } + + getDomain() { + const self = this; + request({ + url: '/diamond-ops/env/domain', + success(data) { + if (data.code === 200) { + const { envGroups } = data.data; + + self.setState({ + envGroups, + }); } - request({ - url: url, - beforeSend: function () { - self.openLoading(); - }, - success: function (result) { - if (result.code === 200) { - let data = result.data; + }, + }); + } - self.field.setValue('dataId', data.dataId); - //self.field.setValue('content', data.content); - self.field.setValue('appName', data.appName); - //self.field.setValue('envs', self.serverId); - self.field.setValue('group', data.group); - //self.field.setValue('md5', data.md5); - self.field.setValue('content', data.content || '' - //let envlist = []; - // let envvalues = []; - // for (let i = 0; i < data.envs.length; i++) { - // let obj = data.envs[i] - // envlist.push({ - // label: obj.name, - // value: obj.serverId - // }) - // envvalues.push(obj.serverId); - // } + getDataDetail() { + const self = this; + this.tenant = getParams('namespace') || ''; + this.serverId = getParams('serverId') || 'center'; + let url = `/diamond-ops/configList/detail/serverId/${this.serverId}/dataId/${ + this.dataId + }/group/${this.group}/tenant/${this.tenant}?id=`; + if (this.tenant === 'global' || !this.tenant) { + url = `/diamond-ops/configList/detail/serverId/${this.serverId}/dataId/${this.dataId}/group/${ + this.group + }?id=`; + } + request({ + url, + beforeSend() { + self.openLoading(); + }, + success(result) { + if (result.code === 200) { + const { data = {} } = result; - ); let env = data.envs || []; - let envvalues = []; - let envlist = []; - for (let i = 0; i < env.length; i++) { - envlist.push({ - value: env[i].serverId, - label: env[i].name - }); - if (env[i].serverId === self.serverId) { - envvalues.push(self.serverId); - } - } - self.setState({ - envlist: envlist, - envvalues: envvalues - // self.setState({ - // envname: env.name, - // }) - //self.serverId = env.serverId; - - }); - } else { - Dialog.alert({ - language: aliwareIntl.currentLanguageCode || 'zh-cn', - title: aliwareIntl.get('com.alibaba.nacos.page.configsync.error'), - content: result.message - }); - } - }, - complete: function () { - self.closeLoading(); + self.field.setValue('dataId', data.dataId); + // self.field.setValue('content', data.content); + self.field.setValue('appName', data.appName); + // self.field.setValue('envs', self.serverId); + self.field.setValue('group', data.group); + // self.field.setValue('md5', data.md5); + self.field.setValue('content', data.content || ''); + const env = data.envs || []; + const envvalues = []; + const envlist = []; + for (let i = 0; i < env.length; i++) { + envlist.push({ + value: env[i].serverId, + label: env[i].name, + }); + if (env[i].serverId === self.serverId) { + envvalues.push(self.serverId); } - }); - } + } + self.setState({ + envlist, + envvalues, + // self.setState({ + // envname: env.name, + // }) + // self.serverId = env.serverId; + }); + } else { + Dialog.alert({ + language: aliwareIntl.currentLanguageCode || 'zh-cn', + title: aliwareIntl.get('com.alibaba.nacos.page.configsync.error'), + content: result.message, + }); + } + }, + complete() { + self.closeLoading(); + }, + }); + } - goList() { + goList() { + this.props.history.push( + `/configurationManagement?serverId=${this.serverId}&group=${this.group}&dataId=${this.dataId}` + ); + } - //console.log(`/configurationManagement?serverId=${this.serverId}&group=${this.group}&dataId=${this.dataId}`) - this.props.history.push(`/configurationManagement?serverId=${this.serverId}&group=${this.group}&dataId=${this.dataId}`); - } - - sync() { - - let self = this; - let payload = { - dataId: this.field.getValue('dataId'), - appName: this.field.getValue('appName'), - group: this.field.getValue('group'), - content: this.field.getValue('content'), - betaIps: this.ips, - targetEnvs: this.envs - - }; - request({ - type: 'put', - contentType: 'application/json', - url: `/diamond-ops/configList/serverId/${this.serverId}/dataId/${payload.dataId}/group/${payload.group}?id=`, - data: JSON.stringify(payload), - success: function (res) { - let _payload = {}; - _payload.maintitle = aliwareIntl.get('com.alibaba.nacos.page.configsync.sync_configuration_main'); - _payload.title = aliwareIntl.get('com.alibaba.nacos.page.configsync.sync_configuration'); - _payload.content = ''; - _payload.dataId = payload.dataId; - _payload.group = payload.group; - if (res.code === 200) { - _payload.isok = true; - } else { - _payload.isok = false; - _payload.message = res.message; - } - self.refs['success'].openDialog(_payload); - }, - error: function () { } - }); - } - syncResult() { - let dataId = this.field.getValue('dataId'); - let gruop = this.field.getValue('group'); - this.props.history.push(`/diamond-ops/static/pages/config-sync/index.html?serverId=center&dataId=${dataId}&group=${gruop}`); - } - changeEnv(values) { - this.targetEnvs = values; - this.setState({ - envvalues: values - }); - } - getIps(value) { - this.ips = value; - } - goResult() { - this.props.history.push(`/consistencyEfficacy?serverId=${this.serverId}&dataId=${this.dataId}&group=${this.group}`); - } - openLoading() { - this.setState({ - loading: true - }); - } - closeLoading() { - - this.setState({ - loading: false - }); - } - render() { - const { init } = this.field; - const formItemLayout = { - labelCol: { - span: 2 - }, - wrapperCol: { - span: 22 - } - }; - - return ( -
    - -

    {aliwareIntl.get('com.alibaba.nacos.page.configsync.sync_configuration')}

    -
    - - - - - -
    - - - - - - -
    - - - - - - - - -
    - -
    -
    - - -
    - - {} - -
    -
    -
    - -
    -
    + sync() { + const self = this; + const payload = { + dataId: this.field.getValue('dataId'), + appName: this.field.getValue('appName'), + group: this.field.getValue('group'), + content: this.field.getValue('content'), + betaIps: this.ips, + targetEnvs: this.envs, + }; + request({ + type: 'put', + contentType: 'application/json', + url: `/diamond-ops/configList/serverId/${this.serverId}/dataId/${payload.dataId}/group/${ + payload.group + }?id=`, + data: JSON.stringify(payload), + success(res) { + const _payload = {}; + _payload.maintitle = aliwareIntl.get( + 'com.alibaba.nacos.page.configsync.sync_configuration_main' ); - } + _payload.title = aliwareIntl.get('com.alibaba.nacos.page.configsync.sync_configuration'); + _payload.content = ''; + _payload.dataId = payload.dataId; + _payload.group = payload.group; + if (res.code === 200) { + _payload.isok = true; + } else { + _payload.isok = false; + _payload.message = res.message; + } + self.refs.success.openDialog(_payload); + }, + error() {}, + }); + } + + syncResult() { + const dataId = this.field.getValue('dataId'); + const gruop = this.field.getValue('group'); + this.props.history.push( + `/diamond-ops/static/pages/config-sync/index.html?serverId=center&dataId=${dataId}&group=${gruop}` + ); + } + + changeEnv(values) { + this.targetEnvs = values; + this.setState({ + envvalues: values, + }); + } + + getIps(value) { + this.ips = value; + } + + goResult() { + this.props.history.push( + `/consistencyEfficacy?serverId=${this.serverId}&dataId=${this.dataId}&group=${this.group}` + ); + } + + openLoading() { + this.setState({ + loading: true, + }); + } + + closeLoading() { + this.setState({ + loading: false, + }); + } + + render() { + const { init } = this.field; + const formItemLayout = { + labelCol: { + span: 2, + }, + wrapperCol: { + span: 22, + }, + }; + + return ( +
    + +

    {aliwareIntl.get('com.alibaba.nacos.page.configsync.sync_configuration')}

    +
    + + + + +
    + + + + + + +
    + + + + + + + + +
    + +
    +
    + +
    + + {} + +
    +
    +
    + +
    +
    + ); + } } -/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/ -export default ConfigSync; \ No newline at end of file + +export default ConfigSync; diff --git a/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigSync/index.js b/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigSync/index.js index b6b04286a..5d676064d 100644 --- a/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigSync/index.js +++ b/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigSync/index.js @@ -13,4 +13,4 @@ import ConfigSync from './ConfigSync'; -export default ConfigSync; \ No newline at end of file +export default ConfigSync; diff --git a/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigurationManagement/ConfigurationManagement.js b/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigurationManagement/ConfigurationManagement.js index 66a6d844d..c6967fc15 100644 --- a/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigurationManagement/ConfigurationManagement.js +++ b/console/src/main/resources/static/src/pages/ConfigurationManagement/ConfigurationManagement/ConfigurationManagement.js @@ -12,6 +12,7 @@ */ import React from 'react'; +import PropTypes from 'prop-types'; import BatchHandle from '../../../components/BatchHandle'; import RegionGroup from '../../../components/RegionGroup'; import ShowCodeing from '../../../components/ShowCodeing'; @@ -21,652 +22,1079 @@ import ImportDialog from '../../../components/ImportDialog'; import ExportDialog from '../../../components/ExportDialog'; import { getParams, setParams, request, aliwareIntl } from '../../../globalLib'; import './index.less'; -import { Balloon, Button, Checkbox, Collapse, Dialog, Dropdown, Field, Form, Icon, Input, Loading, Menu, Pagination, Select, Slider, Table } from '@alifd/next'; -const Accordion = Collapse; -const FormItem = Form.Item; +import { + Balloon, + Button, + Checkbox, + Collapse, + Dialog, + Dropdown, + Field, + Form, + Icon, + Input, + Loading, + Menu, + Pagination, + Select, + Slider, + Table, +} from '@alifd/next'; + const { Panel } = Collapse; -/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/ -const DashboardCard = ({ data, height }) =>
    - {data.modeType === 'notice' ?
    1 ? 20 : 10 }} arrows={false}> - {data.modeList.map((item, index) =>
    -
    -
    {aliwareIntl.get("nacos.page.configurationManagement.Important_reminder0") /*重要提醒*/}
    +const DashboardCard = ({ data = {}, height }) => ( +
    + {data.modeType === 'notice' ? ( +
    + 1 ? 20 : 10 }} arrows={false}> + {data.modeList.map((item, index) => ( +
    +
    +
    + {aliwareIntl.get( + 'nacos.page.configurationManagement.Important_reminder0' + ) /* 重要提醒 */} +
    - {item.title} + {item.title} - {aliwareIntl.get("nacos.page.configurationManagement.view_details1") /*查看详情*/} + + + {aliwareIntl.get( + 'nacos.page.configurationManagement.view_details1' + ) /* 查看详情 */} + + +
    -
    )} -
    :
    -

    {data.modeName}

    -
    - {data.modeList ? data.modeList.map(item => { - return
    - {item.title} - {item.tag === 'new' ? : ''} - {item.tag === 'hot' ? : ''} -
    ; - }) : ''} -
    -
    }
    ; + ))} + {' '} +
    + ) : ( +
    +

    {data.modeName}

    +
    + {data.modeList + ? data.modeList.map(item => ( +
    + + {item.title} + + {item.tag === 'new' ? ( + + ) : ( + '' + )} + {item.tag === 'hot' ? ( + + ) : ( + '' + )} +
    + )) + : ''} +
    +
    + )}{' '} +
    +); +DashboardCard.propTypes = { + data: PropTypes.object, + height: PropTypes.number, +}; + class ConfigurationManagement extends React.Component { - constructor(props) { - super(props); - this.field = new Field(this); - this.appName = getParams('appName') || getParams('edasAppId') || ''; - this.preAppName = this.appName; - this.group = getParams('group') || ''; - this.preGroup = this.group; - this.dataId = getParams('dataId') || ''; - this.preDataId = this.dataId; - this.serverId = getParams('serverId') || 'center'; - this.edasAppId = getParams('edasAppId') || ''; - this.edasAppName = getParams('edasAppName') || ''; - this.inApp = this.edasAppId; - this.state = { - value: "", - visible: false, - total: 0, - pageSize: 10, - currentPage: 1, - dataSource: [], - fieldValue: [], - showAppName: false, - showgroup: false, - dataId: this.dataId, - group: this.group, - appName: this.appName, - config_tags: [], - tagLst: [], - selectValue: [], - loading: false, - groupList: [], - groups: [], - tenant: true, - nownamespace_id: window.nownamespace || '', - nownamespace_name: window.namespaceShowName || '', - selectedRecord: [], - selectedKeys: [], - hasdash: false, - isCn: true, - contentList: [], - isAdvancedQuery: false, - isCheckAll: false - }; - let obj = { - dataId: this.dataId || '', - group: this.preGroup || '', - appName: this.appName || '' - }; - setParams(obj); - this.batchHandle = null; - this.toggleShowQuestionnaire = this.toggleShowQuestionnaire.bind(this); - } + static propTypes = { + history: PropTypes.object, + }; - componentDidMount() { - // this.getGroup(); - if (aliwareIntl.currentLanguageCode === 'zh-cn') { - // this.getContentList(); //在中文站获取概览页 - this.setState({ - isCn: true - }); - } else { - this.setState({ - isCn: false - }); - } - if (window._getLink && window._getLink("isCn") === "true") { - if (!this.checkQuestionnaire()) { - if (window.location.host === 'acm.console.aliyun.com') { - Dialog.alert({ - title: aliwareIntl.get("nacos.page.configurationManagement.questionnaire2") /*问卷调查*/ - , style: { - width: '60%' - }, - content:
    -
    {aliwareIntl.get("nacos.page.configurationManagement.a_ACM_front-end_monitoring_questionnaire,_the_time_limit_to_receive_Ali_cloud_voucher_details_shoved_stamp_the3") /*答ACM前端监控调查问卷,限时领取阿里云代金券详情猛戳:*/}{aliwareIntl.get("nacos.page.configurationManagement.questionnaire2") /*问卷调查*/} -
    -
    {aliwareIntl.get("nacos.page.configurationManagement.no_longer_display4") /*不再显示:*/} -
    -
    , - language: aliwareIntl.currentLanguageCode - }); - } - } - } - } - /** - * 获取概览页数据 - */ - getContentList() { - - request({ - url: 'com.alibaba.nacos.service.dashlist', //以 com.alibaba. 开头最终会转换为真正的url地址 - data: {}, - $data: {}, //替换请求url路径中{}占位符的内容 - success: res => { - console.log(res); - if (res.code === 200 && res.data) { - if (res.data.length === 0) { - this.setState({ - hasdash: false - }); - } else { - this.setState({ - hasdash: true, - contentList: res.data - }); - } - } - } - }); - } - toggleShowQuestionnaire(value) { - if (value) { - localStorage.setItem('acm_questionnaire', 1); - } else { - localStorage.removeItem('acm_questionnaire'); - } - } - checkQuestionnaire() { - - let acm_questionnaire = localStorage.getItem('acm_questionnaire'); - if (acm_questionnaire) { - return true; - } else { - return false; - } - } - - /** - * 回车事件 - */ - keyDownSearch(e) { - var theEvent = e || window.event; - var code = theEvent.keyCode || theEvent.which || theEvent.charCode; - if (code === 13) { - this.getData(); - return false; - } - return true; - } - navTo(url, record) { - - this.serverId = getParams('serverId') || ''; - this.tenant = getParams('namespace') || ''; //为当前实例保存tenant参数 - this.props.history.push(`${url}?serverId=${this.serverId || ''}&dataId=${record.dataId}&group=${record.group}&namespace=${this.tenant}`); - } - openLoading() { - this.setState({ - loading: true - }); - } - - closeLoading() { - this.setState({ - loading: false - }); - } - UNSAFE_componentWillMount() { - window.addEventListener('keydown', this.keyDownSearch.bind(this), false); - } - componentWillUnMount() { - window.removeEventListener('keydown', this.keyDownSearch.bind(this)); - } - onSearch() { } - - onChange() { } - cleanAndGetData(needclean = false) { - if (needclean) { - this.dataId = ''; - this.group = ''; - this.setState({ - group: '', - dataId: '' - }); - setParams({ - group: '', - dataId: '' - }); - } - this.getData(); - } - getData(pageNo = 1, clearSelect = true) { - let self = this; - this.tenant = getParams('namespace') || ''; //为当前实例保存tenant参数 - this.serverId = getParams('serverId') || ''; - let urlPrefix = ""; - if (this.dataId.indexOf("*") !== -1 || this - .group.indexOf("*") !== -1) { - urlPrefix = "/nacos/v1/cs/configs?search=blur"; - } else { - urlPrefix = "/nacos/v1/cs/configs?search=accurate"; - } - - request({ - url: `${urlPrefix}&dataId=${this.dataId}&group=${this.group}&appName=${this.appName}&config_tags=${this.state.config_tags || ''}&pageNo=${pageNo}&pageSize=${this.state.pageSize}`, - beforeSend: function () { - self.openLoading(); - }, - success: function (data) { - if (data != null) { - self.setState({ - dataSource: data.pageItems, - total: data.totalCount, - currentPage: data.pageNumber - }); - if (clearSelect) { - self.setState({ - selectedRecord: [], - selectedKeys: [] - }); - } - } - self.setState({ - tenant: self.tenant - }); - }, - error: function (data) { - self.setState({ - dataSource: [], - total: 0, - currentPage: 0 - }); - }, - complete: function () { - self.closeLoading(); - } - }); - } - showMore() { } - chooseNav(record, key) { - let self = this; - switch (key) { - case 'nav1': - self.navTo('/historyRollback', record); - break; - case 'nav2': - self.navTo('/pushTrajectory', record); - break; - default: - case 'nav3': - self.navTo('/listeningToQuery', record); - break; - } - } - removeConfig(record) { - let self = this; - Dialog.confirm({ - language: aliwareIntl.currentLanguageCode || 'zh-cn', - title: aliwareIntl.get('com.alibaba.nacos.page.configurationManagement.Remove_configuration'), - content:
    -

    {aliwareIntl.get('com.alibaba.nacos.page.configurationManagement.suredelete')}

    -

    - Data ID: - - {record.dataId} - -

    -

    - Group: - - {record.group} - -

    -

    - {aliwareIntl.get('com.alibaba.nacos.page.configurationManagement.environment')} - - {self.serverId || ''} - -

    - -
    , - onOk: () => { - let url = `/nacos/v1/cs/configs?dataId=${record.dataId}&group=${record.group}`; - request({ - url: url, - type: 'delete', - success: function (res) { - let _payload = {}; - - _payload.title = aliwareIntl.get('com.alibaba.nacos.page.configurationManagement.configuration_management'); - _payload.content = ''; - _payload.dataId = record.dataId; - _payload.group = record.group; - if (res === true) { - _payload.isok = true; - } else { - _payload.isok = false; - _payload.message = res.message; - } - self.refs['delete'].openDialog(_payload); - self.getData(); - } - }); - } - }); - } - renderLastTime(value, index, record) { - return
    {aliwareIntl.intlNumberFormat(record.lastModifiedTime)}
    ; - } - showCode(record) { - this.refs['showcode'].openDialog(record); - } - renderCol(value, index, record) { - - return
    - {aliwareIntl.get('com.alibaba.nacos.page.configurationManagement.details')} - | - {aliwareIntl.get('com.alibaba.nacos.page.configurationManagement.the_sample_code')} - | - {aliwareIntl.get('com.alibaba.nacos.page.configurationManagement.edit')} - | - {aliwareIntl.get('com.alibaba.nacos.page.configurationManagement.delete')} - | - - {aliwareIntl.get('com.alibaba.nacos.page.configurationManagement.more')}} triggerType={"click"}> - - {aliwareIntl.get('com.alibaba.nacos.page.configurationManagement.version')} - {aliwareIntl.get('com.alibaba.nacos.page.configurationManagement.listener_query')} - - - -
    ; - } - changePage(value) { - this.setState({ - currentPage: value - }, () => { - this.getData(value, false); - }); - } - handlePageSizeChange(pageSize) { - this.setState({ - pageSize - }, () => { - this.changePage(1); - }); - } - onInputUpdate() { } - chooseFieldChange(fieldValue) { - - this.setState({ - fieldValue - }); - } - showSelect(value) { - this.setState({ - selectValue: value - }); - if (value.indexOf('appName') !== -1) { - this.setState({ - showAppName: true - }); - } else { - this.setState({ - showAppName: false - }); - } - if (value.indexOf('group') !== -1) { - this.setState({ - showgroup: true - }); - } else { - this.setState({ - showgroup: false - }); - } - this.chooseFieldChange(value); - } - getAppName(value) { - this.appName = value; - this.setState({ - appName: value - }); - } - - setAppName(value) { - this.appName = value; - this.setState({ - appName: value - }); - } - getDataId(value) { - this.dataId = value; - this.setState({ - dataId: value - }); - } - setConfigTags(value) { - this.setState({ - config_tags: value - }); - } - /** - * groupId赋值 - */ - setGroup(value) { - this.group = value || ''; - this.setState({ - group: value || '' - }); - } - selectAll() { - setParams('dataId', this.dataId); - setParams('group', this.group); - setParams('appName', this.appName); - this.getData(); - } - resetAll() { - this.dataId = ''; - this.appName = ''; - this.group = ''; - this.setState({ - selectValue: [], - dataId: '', - appName: '', - group: '', - showAppName: false, - showgroup: false - }); - this.selectAll(); - } - chooseEnv(value) { - this.serverId = getParams('serverId') || 'center'; - this.tenant = getParams('namespace') || ''; //为当前实例保存tenant参数 - this.props.history.push(`/newconfig?serverId=${this.serverId || ''}&namespace=${this.tenant}&edasAppName=${this.edasAppName}&edasAppId=${this.edasAppId}&searchDataId=${this.dataId}&searchGroup=${this.group}`); - } - setNowNameSpace(name, id) { - this.setState({ - nownamespace_name: name, - nownamespace_id: id - }); - } - goDetail(record) { - this.serverId = getParams('serverId') || 'center'; - this.tenant = getParams('namespace') || ''; //为当前实例保存tenant参数 - // 点击详情到另一个页面, 返回时候要保留原来的搜索条件 比如: record.dataId为详情的, this.dataId为搜索条件的. - this.props.history.push(`/configdetail?serverId=${this.serverId || ''}&dataId=${record.dataId}&group=${record.group}&namespace=${this.tenant}&edasAppName=${this.edasAppName}&searchDataId=${this.dataId}&searchGroup=${this.group}`); - } - goEditor(record) { - this.serverId = getParams('serverId') || 'center'; - this.tenant = getParams('namespace') || ''; //为当前实例保存tenant参数 - this.props.history.push(`/configeditor?serverId=${this.serverId || ''}&dataId=${record.dataId}&group=${record.group}&namespace=${this.tenant}&edasAppName=${this.edasAppName}&edasAppId=${this.edasAppId}&searchDataId=${this.dataId}&searchGroup=${this.group}`); - } - goConfigSync(record) { - this.serverId = getParams('serverId') || 'center'; - this.tenant = getParams('namespace') || ''; //为当前实例保存tenant参数 - this.props.history.push(`/configsync?serverId=${this.serverId || ''}&dataId=${record.dataId}&group=${record.group}&namespace=${this.tenant}`); - } - - onSelectChange(...args) { - let record = []; - console.log(args, 'args'); - args[1].forEach(item => { - if (args[0].indexOf(item.id) >= 0 && this.state.selectedKeys.indexOf(item.id) < 0) { - record.push(item); - } - }); - this.state.selectedRecord.forEach(item => { - if (args[0].indexOf(item.id) >= 0) { - record.push(item); - } - }); - this.setState({ - selectedRecord: record, - selectedKeys: args[0], - isCheckAll: record.length > 0 && record.length === this.state.dataSource.length - }); - console.log(this.state, 'this.state'); - } - - onPageSelectAll(selected, records) { - console.log(this.refs["dataTable"].props.dataSource); - } - - getBatchFailedContent(res) { - return
    -
    {res.message}
    - {"data" in res && res.data != null && - {"failedItems" in res.data && res.data.failedItems.length > 0 ? - - - -
    -
    : } - {"succeededItems" in res.data && res.data.succeededItems.length > 0 ? - - - -
    -
    : } - {"unprocessedItems" in res.data && res.data.unprocessedItems.length > 0 ? - - - -
    -
    : } -
    } -
    ; - } - onClickBatchHandle() { - this.batchHandle && this.batchHandle.openDialog({ - serverId: this.serverId, - group: this.group, - dataId: this.dataId, - appName: this.appName, - config_tags: this.state.config_tags || '', - pageSize: this.state.pageSize - }); - } - changeAdvancedQuery = () => { - this.setState({ - isAdvancedQuery: !this.state.isAdvancedQuery - }); + constructor(props) { + super(props); + this.field = new Field(this); + this.appName = getParams('appName') || getParams('edasAppId') || ''; + this.preAppName = this.appName; + this.group = getParams('group') || ''; + this.preGroup = this.group; + this.dataId = getParams('dataId') || ''; + this.preDataId = this.dataId; + this.serverId = getParams('serverId') || 'center'; + this.edasAppId = getParams('edasAppId') || ''; + this.edasAppName = getParams('edasAppName') || ''; + this.inApp = this.edasAppId; + this.state = { + value: '', + visible: false, + total: 0, + pageSize: 10, + currentPage: 1, + dataSource: [], + fieldValue: [], + showAppName: false, + showgroup: false, + dataId: this.dataId, + group: this.group, + appName: this.appName, + config_tags: [], + tagLst: [], + selectValue: [], + loading: false, + groupList: [], + groups: [], + tenant: true, + nownamespace_id: window.nownamespace || '', + nownamespace_name: window.namespaceShowName || '', + selectedRecord: [], + selectedKeys: [], + hasdash: false, + isCn: true, + contentList: [], + isAdvancedQuery: false, + isCheckAll: false, }; - checkAllHandle(checked) { - this.setState({ - isCheckAll: checked, - selectedKeys: checked ? this.state.dataSource.map(item => item.id) : [], - selectedRecord: checked ? this.state.dataSource : [] + const obj = { + dataId: this.dataId || '', + group: this.preGroup || '', + appName: this.appName || '', + }; + setParams(obj); + this.batchHandle = null; + this.toggleShowQuestionnaire = this.toggleShowQuestionnaire.bind(this); + } + + componentDidMount() { + // this.getGroup(); + if (aliwareIntl.currentLanguageCode === 'zh-cn') { + // this.getContentList(); //在中文站获取概览页 + this.setState({ + isCn: true, + }); + } else { + this.setState({ + isCn: false, + }); + } + if (window._getLink && window._getLink('isCn') === 'true') { + if (!this.checkQuestionnaire()) { + if (window.location.host === 'acm.console.aliyun.com') { + Dialog.alert({ + title: aliwareIntl.get( + 'nacos.page.configurationManagement.questionnaire2' + ) /* 问卷调查 */, + style: { + width: '60%', + }, + content: ( +
    +
    + {aliwareIntl.get( + 'nacos.page.configurationManagement.a_ACM_front-end_monitoring_questionnaire,_the_time_limit_to_receive_Ali_cloud_voucher_details_shoved_stamp_the3' + ) /* 答ACM前端监控调查问卷,限时领取阿里云代金券详情猛戳: */} + + {aliwareIntl.get( + 'nacos.page.configurationManagement.questionnaire2' + ) /* 问卷调查 */} + +
    +
    + {aliwareIntl.get( + 'nacos.page.configurationManagement.no_longer_display4' + ) /* 不再显示: */} + +
    +
    + ), + language: aliwareIntl.currentLanguageCode, + }); + } + } + } + } + + /** + * 获取概览页数据 + */ + getContentList() { + request({ + url: 'com.alibaba.nacos.service.dashlist', // 以 com.alibaba. 开头最终会转换为真正的url地址 + data: {}, + $data: {}, // 替换请求url路径中{}占位符的内容 + success: res => { + if (res.code === 200 && res.data) { + if (res.data.length === 0) { + this.setState({ + hasdash: false, + }); + } else { + this.setState({ + hasdash: true, + contentList: res.data, + }); + } + } + }, + }); + } + + toggleShowQuestionnaire(value) { + if (value) { + localStorage.setItem('acm_questionnaire', 1); + } else { + localStorage.removeItem('acm_questionnaire'); + } + } + + checkQuestionnaire() { + const acm_questionnaire = localStorage.getItem('acm_questionnaire'); + if (acm_questionnaire) { + return true; + } else { + return false; + } + } + + /** + * 回车事件 + */ + keyDownSearch(e) { + const theEvent = e || window.event; + const code = theEvent.keyCode || theEvent.which || theEvent.charCode; + if (code === 13) { + this.getData(); + return false; + } + return true; + } + + navTo(url, record) { + this.serverId = getParams('serverId') || ''; + this.tenant = getParams('namespace') || ''; // 为当前实例保存tenant参数 + this.props.history.push( + `${url}?serverId=${this.serverId || ''}&dataId=${record.dataId}&group=${ + record.group + }&namespace=${this.tenant}` + ); + } + + openLoading() { + this.setState({ + loading: true, + }); + } + + closeLoading() { + this.setState({ + loading: false, + }); + } + + UNSAFE_componentWillMount() { + window.addEventListener('keydown', this.keyDownSearch.bind(this), false); + } + + componentWillUnmount() { + window.removeEventListener('keydown', this.keyDownSearch.bind(this)); + } + + onSearch() {} + + onChange() {} + + cleanAndGetData(needclean = false) { + if (needclean) { + this.dataId = ''; + this.group = ''; + this.setState({ + group: '', + dataId: '', + }); + setParams({ + group: '', + dataId: '', + }); + } + this.getData(); + } + + getData(pageNo = 1, clearSelect = true) { + const self = this; + this.tenant = getParams('namespace') || ''; // 为当前实例保存tenant参数 + this.serverId = getParams('serverId') || ''; + let urlPrefix = ''; + if (this.dataId.indexOf('*') !== -1 || this.group.indexOf('*') !== -1) { + urlPrefix = '/nacos/v1/cs/configs?search=blur'; + } else { + urlPrefix = '/nacos/v1/cs/configs?search=accurate'; + } + + request({ + url: `${urlPrefix}&dataId=${this.dataId}&group=${this.group}&appName=${ + this.appName + }&config_tags=${this.state.config_tags || ''}&pageNo=${pageNo}&pageSize=${ + this.state.pageSize + }`, + beforeSend() { + self.openLoading(); + }, + success(data) { + if (data != null) { + self.setState({ + dataSource: data.pageItems, + total: data.totalCount, + currentPage: data.pageNumber, + }); + if (clearSelect) { + self.setState({ + selectedRecord: [], + selectedKeys: [], + }); + } + } + self.setState({ + tenant: self.tenant, }); + }, + error(data) { + self.setState({ + dataSource: [], + total: 0, + currentPage: 0, + }); + }, + complete() { + self.closeLoading(); + }, + }); + } + + showMore() {} + + chooseNav(record, key) { + const self = this; + switch (key) { + case 'nav1': + self.navTo('/historyRollback', record); + break; + case 'nav2': + self.navTo('/pushTrajectory', record); + break; + default: + case 'nav3': + self.navTo('/listeningToQuery', record); + break; } - render() { - const pubnodedata = aliwareIntl.get('pubnodata'); - const locale = { - empty: pubnodedata - }; - const helpDataId = Data ID } align={"t"} style={{ marginRight: 5 }} triggerType={"hover"}> - {aliwareIntl.get('com.alibaba.nacos.page.configurationManagement.click_to_learn_DataId')} - ; - const helpGroup = Group } align={"t"} style={{ marginRight: 5 }} triggerType={"hover"}> - {aliwareIntl.get('com.alibaba.nacos.page.configurationManagement.click_to_learn_Group')} - ; - return ( -
    - this.batchHandle = ref} /> - -
    -
    -
    - -
    -
    -

    - {aliwareIntl.get("nacos.page.configurationManagement.configuration_management8") /*配置管理*/} - | - {this.state.nownamespace_name} - {this.state.nownamespace_id} - {aliwareIntl.get('com.alibaba.nacos.page.configurationManagement.query_results')} -  {this.state.total}  - {aliwareIntl.get('com.alibaba.nacos.page.configurationManagement.article_meet_the_requirements')} -

    -
    -
    -
    -
    -
    - - - + } - - - - - - - - -
    - {aliwareIntl.get("nacos.page.configurationManagement.advanced_query9") /*高级查询*/} -
    -
    -
    - - + removeConfig(record) { + const self = this; + Dialog.confirm({ + language: aliwareIntl.currentLanguageCode || 'zh-cn', + title: aliwareIntl.get('com.alibaba.nacos.page.configurationManagement.Remove_configuration'), + content: ( +
    +

    {aliwareIntl.get('com.alibaba.nacos.page.configurationManagement.suredelete')}

    +

    + Data ID: + {record.dataId} +

    +

    + Group: + {record.group} +

    +

    + + {aliwareIntl.get('com.alibaba.nacos.page.configurationManagement.environment')} + + {self.serverId || ''} +

    +
    + ), + onOk: () => { + const url = `/nacos/v1/cs/configs?dataId=${record.dataId}&group=${record.group}`; + request({ + url, + type: 'delete', + success(res) { + const _payload = {}; -
    - - + + + + + + + + + +
    + + {aliwareIntl.get( + 'nacos.page.configurationManagement.advanced_query9' + ) /* 高级查询 */} + +
    - +
    +
    + + + + + - -
    -
    - - - - - - -
    - - - - - - - - - - - + getDataDetail() { + const self = this; - -
    + request({ + url: `/nacos/v1/cs/history?dataId=${this.dataId}&group=${this.group}&nid=${this.nid}`, + success(result) { + if (result != null) { + const data = result; + self.field.setValue('dataId', data.dataId); + self.field.setValue('content', data.content); + self.field.setValue('appName', self.inApp ? self.edasAppName : data.appName); + self.field.setValue('envs', self.serverId); + self.field.setValue('opType', self.typeMap[data.opType.trim()]); + self.field.setValue('group', data.group); + self.field.setValue('md5', data.md5); + } + }, + }); + } + + goList() { + this.props.history.push( + `/historyRollback?serverId=${this.serverId}&group=${this.group}&dataId=${ + this.dataId + }&namespace=${this.tenant}` + ); + } + + render() { + const { init } = this.field; + const formItemLayout = { + labelCol: { + fixedSpan: 6, + }, + wrapperCol: { + span: 18, + }, + }; + return ( +
    +

    {aliwareIntl.get('com.alibaba.nacos.page.historyDetail.history_details')}

    +
    + + + - ); - } + +
    + + + + + + +
    + + + + + + + + + + + + +
    +
    + ); + } } -/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/ -export default HistoryDetail; \ No newline at end of file + +export default HistoryDetail; diff --git a/console/src/main/resources/static/src/pages/ConfigurationManagement/HistoryDetail/index.js b/console/src/main/resources/static/src/pages/ConfigurationManagement/HistoryDetail/index.js index 7f37cff52..55f6dd38d 100644 --- a/console/src/main/resources/static/src/pages/ConfigurationManagement/HistoryDetail/index.js +++ b/console/src/main/resources/static/src/pages/ConfigurationManagement/HistoryDetail/index.js @@ -13,4 +13,4 @@ import HistoryDetail from './HistoryDetail'; -export default HistoryDetail; \ No newline at end of file +export default HistoryDetail; diff --git a/console/src/main/resources/static/src/pages/ConfigurationManagement/HistoryRollback/HistoryRollback.js b/console/src/main/resources/static/src/pages/ConfigurationManagement/HistoryRollback/HistoryRollback.js index 57a954ed7..52219b48d 100644 --- a/console/src/main/resources/static/src/pages/ConfigurationManagement/HistoryRollback/HistoryRollback.js +++ b/console/src/main/resources/static/src/pages/ConfigurationManagement/HistoryRollback/HistoryRollback.js @@ -17,302 +17,391 @@ import RegionGroup from '../../../components/RegionGroup'; import { getParams, setParams, request, aliwareIntl } from '../../../globalLib'; import './index.less'; -/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/ class HistoryRollback extends React.Component { - constructor(props) { - super(props); + constructor(props) { + super(props); - this.field = new Field(this); - this.appName = getParams('appName') || ''; - this.preAppName = this.appName; - this.group = getParams('group') || ''; - this.preGroup = this.group; + this.field = new Field(this); + this.appName = getParams('appName') || ''; + this.preAppName = this.appName; + this.group = getParams('group') || ''; + this.preGroup = this.group; - this.dataId = getParams('dataId') || ''; - this.preDataId = this.dataId; - this.serverId = getParams('serverId') || ''; - this.state = { - value: "", - visible: false, - total: 0, - pageSize: 10, - currentPage: 1, - dataSource: [], - fieldValue: [], - showAppName: false, - showgroup: false, - dataId: this.dataId, - group: this.group, - appName: this.appName, - selectValue: [], - loading: false - }; - let obj = { - dataId: this.dataId || '', - group: this.preGroup || '', - appName: this.appName || '', - serverId: this.serverId || '' - }; - setParams(obj); + this.dataId = getParams('dataId') || ''; + this.preDataId = this.dataId; + this.serverId = getParams('serverId') || ''; + this.state = { + value: '', + visible: false, + total: 0, + pageSize: 10, + currentPage: 1, + dataSource: [], + fieldValue: [], + showAppName: false, + showgroup: false, + dataId: this.dataId, + group: this.group, + appName: this.appName, + selectValue: [], + loading: false, + }; + const obj = { + dataId: this.dataId || '', + group: this.preGroup || '', + appName: this.appName || '', + serverId: this.serverId || '', + }; + setParams(obj); + } + + componentDidMount() { + this.field.setValue('group', this.group); + this.field.setValue('dataId', this.dataId); + // this.getData() + } + + openLoading() { + this.setState({ + loading: true, + }); + } + + closeLoading() { + this.setState({ + loading: false, + }); + } + + /** + * 回车事件 + */ + keyDownSearch(e) { + const theEvent = e || window.event; + const code = theEvent.keyCode || theEvent.which || theEvent.charCode; + if (code === 13) { + this.getData(); + return false; + } + return true; + } + + UNSAFE_componentWillMount() { + window.addEventListener('keydown', this.keyDownSearch.bind(this), false); + } + + componentWillUnmount() { + window.removeEventListener('keydown', this.keyDownSearch.bind(this)); + } + + onSearch() {} + + onChange() {} + + cleanAndGetData(needclean = false) { + if (needclean) { + this.dataId = ''; + this.group = ''; + this.setState({ + group: '', + dataId: '', + }); + setParams({ + group: '', + dataId: '', + }); } - componentDidMount() { - this.field.setValue('group', this.group); - this.field.setValue('dataId', this.dataId); - //this.getData() - } - openLoading() { - this.setState({ - loading: true - }); - } - closeLoading() { - this.setState({ - loading: false - }); - } - /** - * 回车事件 - */ - keyDownSearch(e) { - var theEvent = e || window.event; - var code = theEvent.keyCode || theEvent.which || theEvent.charCode; - if (code === 13) { - this.getData(); - return false; + this.getData(); + } + + getData(pageNo = 1) { + const self = this; + this.serverId = getParams('serverId') || ''; + if (!this.dataId) return false; + request({ + beforeSend() { + self.openLoading(); + }, + url: `/nacos/v1/cs/history?search=accurate&dataId=${this.dataId}&group=${ + this.group + }&&pageNo=${pageNo}&pageSize=${this.state.pageSize}`, + success(data) { + if (data != null) { + self.setState({ + dataSource: data.pageItems || [], + total: data.totalCount, + currentPage: data.pageNumber, + }); } - return true; - } - UNSAFE_componentWillMount() { - window.addEventListener('keydown', this.keyDownSearch.bind(this), false); - } - componentWillUnMount() { - window.removeEventListener('keydown', this.keyDownSearch.bind(this)); - } - onSearch() { } + }, + complete() { + self.closeLoading(); + }, + }); + } - onChange() { } - cleanAndGetData(needclean = false) { - if (needclean) { - this.dataId = ''; - this.group = ''; - this.setState({ - group: '', - dataId: '' - }); - setParams({ - group: '', - dataId: '' - }); - } + showMore() {} - this.getData(); - } - getData(pageNo = 1) { - let self = this; - this.serverId = getParams('serverId') || ''; - if (!this.dataId) return false; - request({ - beforeSend: function () { - self.openLoading(); - }, - url: `/nacos/v1/cs/history?search=accurate&dataId=${this.dataId}&group=${this.group}&&pageNo=${pageNo}&pageSize=${this.state.pageSize}`, - success: function (data) { - if (data != null) { - self.setState({ - dataSource: data.pageItems || [], - total: data.totalCount, - currentPage: data.pageNumber - }); - } - }, - complete: function () { - self.closeLoading(); - } - }); - } - showMore() { } - renderCol(value, index, record) { - return ; - } - changePage(value) { - this.setState({ - currentPage: value - }); - this.getData(value); - } - onInputUpdate() { } - chooseFieldChange(fieldValue) { + renderCol(value, index, record) { + return ( + + ); + } - this.setState({ - fieldValue - }); - } - showSelect(value) { - this.setState({ - selectValue: value - }); - if (value.indexOf('appName') !== -1) { - this.setState({ - showAppName: true - }); - } else { - this.setState({ - showAppName: false - }); - } - if (value.indexOf('group') !== -1) { - this.setState({ - showgroup: true - }); - } else { - this.setState({ - showgroup: false - }); - } - this.chooseFieldChange(value); - } - getAppName(value) { - this.appName = value; - this.setState({ - appName: value - }); - } - getDataId(value) { - this.dataId = value; - this.setState({ - dataId: value - }); - } - getGroup(value) { + changePage(value) { + this.setState({ + currentPage: value, + }); + this.getData(value); + } - this.group = value; - this.setState({ - group: value - }); - } - selectAll() { - this.dataId = this.field.getValue("dataId"); - this.group = this.field.getValue("group"); - if (!this.dataId || !this.group) { - return false; - } - if (this.dataId !== this.preDataId) { - setParams('dataId', this.dataId); - this.preDataId = this.dataId; - } - if (this.group !== this.preGroup) { - setParams('group', this.preGroup); - this.preGroup = this.group; - } - this.getData(); - } - resetAll() { - this.dataId = ''; - this.group = ''; - this.setState({ - selectValue: [], - dataId: '', - appName: '', - group: '', - showAppName: false, - showgroup: false - }); - setParams({ - group: '', - dataId: '' - }); - } - chooseEnv(value) { - console.log(value); - } - renderLastTime(value, index, record) { - return aliwareIntl.intlTimeFormat(record.lastModifiedTime); - } - goDetail(record) { - this.serverId = getParams('serverId') || 'center'; - this.tenant = getParams('namespace') || ''; //为当前实例保存tenant参数 - this.props.history.push(`/historyDetail?serverId=${this.serverId || ''}&dataId=${record.dataId}&group=${record.group}&nid=${record.id}&namespace=${this.tenant}`); - } - goRollBack(record) { - this.serverId = getParams('serverId') || 'center'; - this.tenant = getParams('namespace') || ''; //为当前实例保存tenant参数 - this.props.history.push(`/configRollback?serverId=${this.serverId || ''}&dataId=${record.dataId}&group=${record.group}&nid=${record.id}&namespace=${this.tenant}&nid=${record.id}`); - } - render() { - const pubnodedata = aliwareIntl.get('pubnodata'); + onInputUpdate() {} - const locale = { - empty: pubnodedata - }; + chooseFieldChange(fieldValue) { + this.setState({ + fieldValue, + }); + } - const { init } = this.field; - this.init = init; + showSelect(value) { + this.setState({ + selectValue: value, + }); + if (value.indexOf('appName') !== -1) { + this.setState({ + showAppName: true, + }); + } else { + this.setState({ + showAppName: false, + }); + } + if (value.indexOf('group') !== -1) { + this.setState({ + showgroup: true, + }); + } else { + this.setState({ + showgroup: false, + }); + } + this.chooseFieldChange(value); + } - return ( -
    - - - {/**
    + getAppName(value) { + this.appName = value; + this.setState({ + appName: value, + }); + } + + getDataId(value) { + this.dataId = value; + this.setState({ + dataId: value, + }); + } + + getGroup(value) { + this.group = value; + this.setState({ + group: value, + }); + } + + selectAll() { + this.dataId = this.field.getValue('dataId'); + this.group = this.field.getValue('group'); + if (!this.dataId || !this.group) { + return false; + } + if (this.dataId !== this.preDataId) { + setParams('dataId', this.dataId); + this.preDataId = this.dataId; + } + if (this.group !== this.preGroup) { + setParams('group', this.preGroup); + this.preGroup = this.group; + } + this.getData(); + } + + resetAll() { + this.dataId = ''; + this.group = ''; + this.setState({ + selectValue: [], + dataId: '', + appName: '', + group: '', + showAppName: false, + showgroup: false, + }); + setParams({ + group: '', + dataId: '', + }); + } + + chooseEnv(value) {} + + renderLastTime(value, index, record) { + return aliwareIntl.intlTimeFormat(record.lastModifiedTime); + } + + goDetail(record) { + this.serverId = getParams('serverId') || 'center'; + this.tenant = getParams('namespace') || ''; // 为当前实例保存tenant参数 + this.props.history.push( + `/historyDetail?serverId=${this.serverId || ''}&dataId=${record.dataId}&group=${ + record.group + }&nid=${record.id}&namespace=${this.tenant}` + ); + } + + goRollBack(record) { + this.serverId = getParams('serverId') || 'center'; + this.tenant = getParams('namespace') || ''; // 为当前实例保存tenant参数 + this.props.history.push( + `/configRollback?serverId=${this.serverId || ''}&dataId=${record.dataId}&group=${ + record.group + }&nid=${record.id}&namespace=${this.tenant}&nid=${record.id}` + ); + } + + render() { + const pubnodedata = aliwareIntl.get('pubnodata'); + + const locale = { + empty: pubnodedata, + }; + + const { init } = this.field; + this.init = init; + + return ( +
    + + + {/**
    -
    **/} +
    * */} -
    -
    +
    + + + + + + + - - - - - - - - - {aliwareIntl.get('com.alibaba.nacos.page.historyrollback.query')} - - - - - -
    -
    - -

    {aliwareIntl.get('com.alibaba.nacos.page.historyRollback.queryresult')} {this.state.total} {aliwareIntl.get('com.alibaba.nacos.page.historyRollback.article_meet')}

    - -
    -
    - - - - - - -
    - -
    -
    - , -
    - -
    - ); - } + + + {aliwareIntl.get('com.alibaba.nacos.page.historyrollback.query')} + + + +
    +
    +

    + {aliwareIntl.get('com.alibaba.nacos.page.historyRollback.queryresult')} +  {this.state.total}  + {aliwareIntl.get('com.alibaba.nacos.page.historyRollback.article_meet')} +

    +
    +
    + + + + + +
    +
    +
    + + , +
    +
    +
    + ); + } } -/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/ -export default HistoryRollback; \ No newline at end of file + +export default HistoryRollback; diff --git a/console/src/main/resources/static/src/pages/ConfigurationManagement/HistoryRollback/index.js b/console/src/main/resources/static/src/pages/ConfigurationManagement/HistoryRollback/index.js index e843afaad..8f1256db6 100644 --- a/console/src/main/resources/static/src/pages/ConfigurationManagement/HistoryRollback/index.js +++ b/console/src/main/resources/static/src/pages/ConfigurationManagement/HistoryRollback/index.js @@ -13,4 +13,4 @@ import HistoryRollback from './HistoryRollback'; -export default HistoryRollback; \ No newline at end of file +export default HistoryRollback; diff --git a/console/src/main/resources/static/src/pages/ConfigurationManagement/ListeningToQuery/ListeningToQuery.js b/console/src/main/resources/static/src/pages/ConfigurationManagement/ListeningToQuery/ListeningToQuery.js index d1ab64aae..42cf00bef 100644 --- a/console/src/main/resources/static/src/pages/ConfigurationManagement/ListeningToQuery/ListeningToQuery.js +++ b/console/src/main/resources/static/src/pages/ConfigurationManagement/ListeningToQuery/ListeningToQuery.js @@ -16,208 +16,321 @@ import RegionGroup from '../../../components/RegionGroup'; import { getParams, request, aliwareIntl } from '../../../globalLib'; import './index.less'; import { Field, Form, Grid, Input, Loading, Pagination, Select, Table } from '@alifd/next'; + const FormItem = Form.Item; const { Row, Col } = Grid; -/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/ class ListeningToQuery extends React.Component { - constructor(props) { - super(props); - this.state = { - value: "", - visible: false, - loading: false, - total: 0, - pageSize: 10, - currentPage: 1, - dataSource: [] - }; - this.field = new Field(this); - this.group = getParams('group') || ''; - this.dataId = getParams('dataId') || ''; - this.serverId = getParams('serverId') || ''; - this.tenant = getParams('namespace') || ''; - } + constructor(props) { + super(props); + this.state = { + value: '', + visible: false, + loading: false, + total: 0, + pageSize: 10, + currentPage: 1, + dataSource: [], + }; + this.field = new Field(this); + this.group = getParams('group') || ''; + this.dataId = getParams('dataId') || ''; + this.serverId = getParams('serverId') || ''; + this.tenant = getParams('namespace') || ''; + } - componentDidMount() { - this.field.setValue('type', 0); - this.field.setValue('group', this.group); - this.field.setValue('dataId', this.dataId); - } + componentDidMount() { + this.field.setValue('type', 0); + this.field.setValue('group', this.group); + this.field.setValue('dataId', this.dataId); + } - onSearch() { } + onSearch() {} - onChange() { } - openLoading() { - this.setState({ - loading: true - }); + onChange() {} + + openLoading() { + this.setState({ + loading: true, + }); + } + + closeLoading() { + this.setState({ + loading: false, + }); + } + + queryTrackQuery = () => { + const self = this; + let queryUrl = ''; + const type = this.getValue('type'); + if (type === 1) { + const ip = this.getValue('ip'); + queryUrl = `/nacos/v1/cs/listener?ip=${ip}`; + const tenant = window.nownamespace || getParams('namespace') || ''; + if (tenant) { + queryUrl += `&tenant=${tenant}`; + } + } else { + const dataId = this.getValue('dataId'); + const group = this.getValue('group'); + if (!dataId || !group) return false; + queryUrl = `/nacos/v1/cs/configs/listener?dataId=${dataId}&group=${group}`; } - closeLoading() { - this.setState({ - loading: false - }); - } - queryTrackQuery() { - var self = this; - var queryUrl = ""; - var type = this.getValue('type'); - if (type === 1) { - var ip = this.getValue('ip'); - queryUrl = `/nacos/v1/cs/listener?ip=${ip}`; - let tenant = window.nownamespace || getParams('namespace') || ''; - if (tenant) { - queryUrl += '&tenant=' + tenant; + request({ + url: queryUrl, + beforeSend() { + self.openLoading(); + }, + success(data) { + if (data.collectStatus === 200) { + const dataSoureTmp = []; + const status = data.lisentersGroupkeyStatus; + for (const key in status) { + if (type === 1) { + const obj = {}; + let [dataId, group] = key.split('+'); + obj.dataId = dataId; + obj.group = group; + obj.md5 = status[key]; + dataSoureTmp.push(obj); + } else { + const obj = {}; + obj.ip = key; + obj.md5 = status[key]; + dataSoureTmp.push(obj); } - } else { - var dataId = this.getValue('dataId'); - var group = this.getValue('group'); - if (!dataId || !group) return false; - queryUrl = `/nacos/v1/cs/configs/listener?dataId=${dataId}&group=${group}`; + } + self.setState({ + dataSource: dataSoureTmp || [], + total: data.length, + }); } - request({ - url: queryUrl, - beforeSend: function () { - self.openLoading(); - }, - success: function (data) { - if (data.collectStatus === 200) { - let dataSoureTmp = []; - let status = data.lisentersGroupkeyStatus; - for (var key in status) { - if (type === 1) { - let obj = {}; - obj.dataId = key.split("+")[0]; - obj.group = key.split("+")[1]; - obj.md5 = status[key]; - dataSoureTmp.push(obj); - } else { - let obj = {}; - obj.ip = key; - obj.md5 = status[key]; - dataSoureTmp.push(obj); - } - } - self.setState({ - dataSource: dataSoureTmp || [], - total: data.length - }); - } - }, - complete: function () { - self.closeLoading(); - } - }); - } + }, + complete() { + self.closeLoading(); + }, + }); + }; - showMore() { } - changePage(value) { - this.setState({ - currentPage: value - }); - } - resetSearch() { - this.field.reset(); - this.forceUpdate(); - } - renderStatus(values, index, record) { - return
    {record.pushStatus === true ? {aliwareIntl.get('com.alibaba.nacos.page.listeningToQuery.success')} : {aliwareIntl.get('com.alibaba.nacos.page.listeningToQuery.failure')}} -
    ; - } - getQueryLater() { - setTimeout(() => { - //子组件可能优先于父组件所以延迟执行 - this.queryTrackQuery(); - }); - } - render() { - const { init, getValue } = this.field; - this.init = init; - this.getValue = getValue; - const pubnodedata = aliwareIntl.get('pubnodata'); + showMore() {} - const locale = { - empty: pubnodedata - }; - const selectDataSource = [ - { - label: aliwareIntl.get('com.alibaba.nacos.page.listeningToQuery.configuration'), - value: 0 - }, - { - label: "IP", - value: 1 - } - ] - return ( -
    - - - {/**
    - -
    **/} - - -
    - - - - - - - - - - - {aliwareIntl.get('com.alibaba.nacos.page.listeningToQuery.query')} - {} - -
    - -
    -
    -

    {aliwareIntl.get('com.alibaba.nacos.page.listeningToQuery.query_results:_query')} {this.state.total} {aliwareIntl.get('com.alibaba.nacos.page.listeningToQuery.article_meet_the_requirements_of_the_configuration.')}

    -
    - - - {this.getValue('type') === 1 ? - - - -
    : - - -
    } - -
    -
    - , -
    -
    -
    - ); - } + changePage = value => { + this.setState({ + currentPage: value, + }); + }; + + resetSearch() { + this.field.reset(); + this.forceUpdate(); + } + + renderStatus(values, index, record) { + return ( +
    + {record.pushStatus === true ? ( + + {aliwareIntl.get('com.alibaba.nacos.page.listeningToQuery.success')} + + ) : ( + + {aliwareIntl.get('com.alibaba.nacos.page.listeningToQuery.failure')} + + )} +
    + ); + } + + getQueryLater = () => { + setTimeout(() => { + // 子组件可能优先于父组件所以延迟执行 + this.queryTrackQuery(); + }); + }; + + render() { + const { init, getValue } = this.field; + this.init = init; + this.getValue = getValue; + const pubnodedata = aliwareIntl.get('pubnodata'); + + const locale = { + empty: pubnodedata, + }; + const selectDataSource = [ + { + label: aliwareIntl.get('com.alibaba.nacos.page.listeningToQuery.configuration'), + value: 0, + }, + { + label: 'IP', + value: 1, + }, + ]; + return ( +
    + + + + +
    + + + + + + + + + + + + {aliwareIntl.get('com.alibaba.nacos.page.listeningToQuery.query')} + + {} + +
    + +
    +
    +

    + {aliwareIntl.get('com.alibaba.nacos.page.listeningToQuery.query_results:_query')} +  {this.state.total}  + {aliwareIntl.get( + 'com.alibaba.nacos.page.listeningToQuery.article_meet_the_requirements_of_the_configuration.' + )} +

    +
    + + + {this.getValue('type') === 1 ? ( + + + + +
    + ) : ( + + + +
    + )} + +
    +
    + + , +
    +
    +
    + ); + } } -/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/ -export default ListeningToQuery; \ No newline at end of file + +export default ListeningToQuery; diff --git a/console/src/main/resources/static/src/pages/ConfigurationManagement/ListeningToQuery/index.js b/console/src/main/resources/static/src/pages/ConfigurationManagement/ListeningToQuery/index.js index 2bdf26404..1701270f6 100644 --- a/console/src/main/resources/static/src/pages/ConfigurationManagement/ListeningToQuery/index.js +++ b/console/src/main/resources/static/src/pages/ConfigurationManagement/ListeningToQuery/index.js @@ -13,4 +13,4 @@ import ListeningToQuery from './ListeningToQuery'; -export default ListeningToQuery; \ No newline at end of file +export default ListeningToQuery; diff --git a/console/src/main/resources/static/src/pages/ConfigurationManagement/NewConfig/NewConfig.js b/console/src/main/resources/static/src/pages/ConfigurationManagement/NewConfig/NewConfig.js index 11d99764f..e9a4eef49 100644 --- a/console/src/main/resources/static/src/pages/ConfigurationManagement/NewConfig/NewConfig.js +++ b/console/src/main/resources/static/src/pages/ConfigurationManagement/NewConfig/NewConfig.js @@ -16,399 +16,536 @@ import $ from 'jquery'; import SuccessDialog from '../../../components/SuccessDialog'; import { getParams, setParams, request, aliwareIntl } from '../../../globalLib'; import './index.less'; -import { Balloon, Button, Dialog, Field, Form, Icon, Input, Loading, Message, Select, Radio } from '@alifd/next'; +import { + Balloon, + Button, + Dialog, + Field, + Form, + Icon, + Input, + Loading, + Message, + Select, + Radio, +} from '@alifd/next'; + const FormItem = Form.Item; const { Group: RadioGroup } = Radio; const { AutoComplete: Combobox } = Select; - -/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/ class NewConfig extends React.Component { - constructor(props) { - super(props); - this.field = new Field(this); - this.edasAppName = getParams('edasAppName') || ''; - this.edasAppId = getParams('edasAppId') || ''; - this.inApp = this.edasAppName; - this.field.setValue('appName', this.inApp ? this.edasAppName : ''); - this.inEdas = window.globalConfig.isParentEdas(); - this.dataId = getParams('dataId') || ''; - this.group = getParams('group') || 'DEFAULT_GROUP'; - this.searchDataId = getParams('searchDataId') || ''; - this.searchGroup = getParams('searchGroup') || ''; - this.state = { - configType: 'text', - codeValue: ``, - envname: '', - targetEnvName: '', - groups: [], - groupNames: [], - envlist: [], - tagLst: [], - config_tags: [], - envvalues: [], - showmore: false, - loading: false, - encrypt: false, - addonBefore: '', - showGroupWarning: false - }; - this.codeValue = ''; - this.mode = 'text'; - this.ips = ''; - } + constructor(props) { + super(props); + this.field = new Field(this); + this.edasAppName = getParams('edasAppName') || ''; + this.edasAppId = getParams('edasAppId') || ''; + this.inApp = this.edasAppName; + this.field.setValue('appName', this.inApp ? this.edasAppName : ''); + this.inEdas = window.globalConfig.isParentEdas(); + this.dataId = getParams('dataId') || ''; + this.group = getParams('group') || 'DEFAULT_GROUP'; + this.searchDataId = getParams('searchDataId') || ''; + this.searchGroup = getParams('searchGroup') || ''; + this.state = { + configType: 'text', + codeValue: '', + envname: '', + targetEnvName: '', + groups: [], + groupNames: [], + envlist: [], + tagLst: [], + config_tags: [], + envvalues: [], + showmore: false, + loading: false, + encrypt: false, + addonBefore: '', + showGroupWarning: false, + }; + this.codeValue = ''; + this.mode = 'text'; + this.ips = ''; + } - componentDidMount() { - this.betaips = document.getElementById('betaips'); - //this.createCodeMirror('text', ''); - this.chontenttab = document.getElementById('chontenttab'); //diff标签 - this.tenant = getParams('namespace') || ''; - this.field.setValue('group', this.group); - if (!window.monaco) { - window.importEditor(() => { - this.initMoacoEditor(); - }); - } else { - this.initMoacoEditor(); - } + componentDidMount() { + this.betaips = document.getElementById('betaips'); + // this.createCodeMirror('text', ''); + this.chontenttab = document.getElementById('chontenttab'); // diff标签 + this.tenant = getParams('namespace') || ''; + this.field.setValue('group', this.group); + if (!window.monaco) { + window.importEditor(() => { + this.initMoacoEditor(); + }); + } else { + this.initMoacoEditor(); } - changeModel(type) { - if (!this.monacoEditor) { - $('#container').empty(); - this.monacoEditor = window.monaco.editor.create(document.getElementById('container'), { - model: null - }); - return; - } - let oldModel = this.monacoEditor.getModel(); - let oldValue = this.monacoEditor.getValue(); - let newModel = window.monaco.editor.createModel(oldValue, type); - this.monacoEditor.setModel(newModel); - //this.monacoEditor.setValue('xx') - if (oldModel) { - oldModel.dispose(); - } + } + + changeModel(type) { + if (!this.monacoEditor) { + $('#container').empty(); + this.monacoEditor = window.monaco.editor.create(document.getElementById('container'), { + model: null, + }); + return; } - initMoacoEditor() { + const oldModel = this.monacoEditor.getModel(); + const oldValue = this.monacoEditor.getValue(); + const newModel = window.monaco.editor.createModel(oldValue, type); + this.monacoEditor.setModel(newModel); + // this.monacoEditor.setValue('xx') + if (oldModel) { + oldModel.dispose(); + } + } + initMoacoEditor() { + this.monacoEditor = window.monaco.editor.create(document.getElementById('container'), { + value: this.codeValue, + language: this.state.configType, + codeLens: true, + selectOnLineNumbers: true, + roundedSelection: false, + readOnly: false, + lineNumbersMinChars: true, + theme: 'vs-dark', + wordWrapColumn: 120, + folding: true, + showFoldingControls: 'always', + wordWrap: 'wordWrapColumn', + cursorStyle: 'line', + automaticLayout: true, + }); + } - this.monacoEditor = window.monaco.editor.create(document.getElementById('container'), { - value: this.codeValue, - language: this.state.configType, - codeLens: true, - selectOnLineNumbers: true, - roundedSelection: false, - readOnly: false, - lineNumbersMinChars: true, - theme: 'vs-dark', - wordWrapColumn: 120, - folding: true, - showFoldingControls: 'always', - wordWrap: 'wordWrapColumn', - cursorStyle: 'line', - automaticLayout: true + setGroup(value) { + this.group = value || ''; + this.field.setValue('group', this.group); + if (this.inEdas) { + this.setState({ + showGroupWarning: this.group !== '' && this.state.groupNames.indexOf(value) < 0, + }); + } + } + + setConfigTags(value) { + if (value.length > 5) { + value.pop(); + } + value.forEach((v, i) => { + if (v.indexOf(',') !== -1 || v.indexOf('=') !== -1) { + value.splice(i, 1); + } + }); + this.setState({ + config_tags: value, + }); + } + + onInputUpdate(value) { + if (this.inputtimmer) { + clearTimeout(this.inputtimmer); + } + this.inputtimmer = setTimeout(() => { + const { tagLst } = this.state; + + let hastag = false; + tagLst.forEach((v, i) => { + if (v.value === value) { + hastag = true; + } + }); + if (!hastag) { + tagLst.push({ + value, + label: value, + time: Math.random(), }); + } + this.setState({ tagLst }); + }, 500); + } + + toggleMore() { + this.setState({ + showmore: !this.state.showmore, + }); + } + + goList() { + this.tenant = getParams('namespace') || ''; + this.serverId = getParams('serverId') || ''; + this.props.history.push( + `/configurationManagement?serverId=${this.serverId}&group=${this.searchGroup}&dataId=${ + this.searchDataId + }&namespace=${this.tenant}` + ); + } + + openLoading() { + this.setState({ + loading: true, + }); + } + + closeLoading() { + this.setState({ + loading: false, + }); + } + + newChangeConfig(value) { + this.setState({ + configType: value, + }); + + this.changeModel(value); + } + + setCodeValue(value) { + this.setState({ + codeValue: value, + }); + } + + publishConfig() { + this.field.validate((errors, values) => { + if (errors) { + return; + } + let content = ''; + const self = this; + if (this.monacoEditor) { + content = this.monacoEditor.getValue(); + } else { + content = this.codeValue; + } + if (!content) { + return; + } + this.tenant = getParams('namespace') || ''; + const payload = { + dataId: self.state.addonBefore + this.field.getValue('dataId'), + group: this.field.getValue('group'), + content, + desc: this.field.getValue('desc'), + config_tags: this.state.config_tags.join(), + type: this.state.configType, + appName: this.inApp ? this.edasAppId : this.field.getValue('appName'), + tenant: this.tenant, + }; + this.serverId = getParams('serverId') || 'center'; + const url = '/nacos/v1/cs/configs'; + request({ + type: 'post', + contentType: 'application/x-www-form-urlencoded', + url, + data: payload, + beforeSend: () => { + this.openLoading(); + }, + success(res) { + const _payload = {}; + _payload.maintitle = aliwareIntl.get('com.alibaba.nacos.page.newconfig.new_listing_main'); + _payload.title = aliwareIntl.get('com.alibaba.nacos.page.newconfig.new_listing'); + _payload.content = ''; + _payload.dataId = payload.dataId; + _payload.group = payload.group; + if (res === true) { + self.group = payload.group; + self.dataId = payload.dataId; + setParams({ group: payload.group, dataId: payload.dataId }); // 设置参数 + _payload.isok = true; + } else { + _payload.isok = false; + _payload.message = res.message; + } + self.refs.success.openDialog(_payload); + }, + complete() { + self.closeLoading(); + }, + error(res) { + Dialog.alert({ + language: aliwareIntl.currentLanguageCode || 'zh-cn', + content: aliwareIntl.get('com.alibaba.nacos.page.newconfig.publish_failed'), + }); + self.closeLoading(); + }, + }); + }); + } + + changeEnv(values) { + this.targetEnvs = values; + this.setState({ + envvalues: values, + }); + } + + changeBeta(selected) { + if (selected) { + this.betaips.style.display = 'block'; + } else { + this.betaips.style.display = 'none'; } + } + getIps(value) { + this.ips = value; + } - setGroup(value) { - this.group = value || ''; - this.field.setValue('group', this.group); - if (this.inEdas) { - this.setState({ - showGroupWarning: this.group !== '' && this.state.groupNames.indexOf(value) < 0 - }); - } + validateChart(rule, value, callback) { + const chartReg = /[@#\$%\^&\*]+/g; + + if (chartReg.test(value)) { + callback(aliwareIntl.get('com.alibaba.nacos.page.newconfig.do_not_ente')); + } else { + callback(); } + } - setConfigTags(value) { - if (value.length > 5) { - value.pop(); - } - value.forEach((v, i) => { - if (v.indexOf(',') !== -1 || v.indexOf('=') !== -1) { - value.splice(i, 1); - } - }); - this.setState({ - config_tags: value - }); - } + render() { + const { init } = this.field; + const formItemLayout = { + labelCol: { + span: 2, + }, + wrapperCol: { + span: 22, + }, + }; - onInputUpdate(value) { - if (this.inputtimmer) { - clearTimeout(this.inputtimmer); - } - this.inputtimmer = setTimeout(() => { - let tagLst = this.state.tagLst, - hastag = false; - tagLst.forEach((v, i) => { - if (v.value === value) { - hastag = true; + // const list = [{ + // value: 0, + // label: 'TEXT' + // }, { + // value: 1, + // label: 'JSON' + // }, { + // value: 2, + // label: 'XML' + // }]; + const list = [ + { + value: 'text', + label: 'TEXT', + }, + { + value: 'json', + label: 'JSON', + }, + { + value: 'xml', + label: 'XML', + }, + { + value: 'yaml', + label: 'YAML', + }, + { + value: 'text/html', + label: 'HTML', + }, + { + value: 'properties', + label: 'Properties', + }, + ]; + + return ( +
    + +

    {aliwareIntl.get('com.alibaba.nacos.page.newconfig.new_listing')}

    +
    + + {this.state.addonBefore}
    + ) : null } - }); - if (!hastag) { - tagLst.push({ - value: value, - label: value, - time: Math.random() - }); - } - this.setState({ tagLst: tagLst }); - }, 500); - } + /> + + + + + + + {aliwareIntl.get( + 'nacos.page.newconfig.Note_You_are_to_be_a_custom_packet_the_new_configuration,_make_sure_that_the_client_use_the_Pandora_version_higher_than_3._4._0,_otherwise_it_may_read_less_than_the_configuration.0' + )} + + + + + - toggleMore() { - this.setState({ - showmore: !this.state.showmore - }); - } - goList() { - this.tenant = getParams('namespace') || ''; - this.serverId = getParams('serverId') || ''; - //console.log(`/configurationManagement?serverId=${this.serverId}&group=${this.group}&dataId=${this.dataId}`) - this.props.history.push(`/configurationManagement?serverId=${this.serverId}&group=${this.searchGroup}&dataId=${this.searchDataId}&namespace=${this.tenant}`); - } - openLoading() { - this.setState({ - loading: true - }); - } - closeLoading() { - this.setState({ - loading: false - }); - } +
    + + {this.state.addonBefore}
    : null} /> - - - - - - - - {aliwareIntl.get('nacos.page.newconfig.Note_You_are_to_be_a_custom_packet_the_new_configuration,_make_sure_that_the_client_use_the_Pandora_version_higher_than_3._4._0,_otherwise_it_may_read_less_than_the_configuration.0')} - - - - - -
    - - - - - - - - -
    - - - - - - - - - {aliwareIntl.get('com.alibaba.nacos.page.newconfig.configuration_format')}} align={"t"} style={{ marginRight: 5 }} triggerType={"hover"}> -

    {aliwareIntl.get('com.alibaba.nacos.page.newconfig.configure_contents_of')}

    -

    {aliwareIntl.get('com.alibaba.nacos.page.newconfig.full_screen')}

    -
    :} required {...formItemLayout}> -
    -
    - - - -
    - - - -
    -
    - - - + + +
    - ); - } + + + + + + + + + + {aliwareIntl.get('com.alibaba.nacos.page.newconfig.configuration_format')} + + } + align={'t'} + style={{ marginRight: 5 }} + triggerType={'hover'} + > +

    + {aliwareIntl.get('com.alibaba.nacos.page.newconfig.configure_contents_of')} +

    +

    {aliwareIntl.get('com.alibaba.nacos.page.newconfig.full_screen')}

    +
    + : + + } + required + {...formItemLayout} + > +
    + + + +
    + + + +
    +
    + + + +
    + ); + } } -/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/ -export default NewConfig; \ No newline at end of file + +export default NewConfig; diff --git a/console/src/main/resources/static/src/pages/ConfigurationManagement/NewConfig/index.js b/console/src/main/resources/static/src/pages/ConfigurationManagement/NewConfig/index.js index 9a507b9a9..377c9a0ed 100644 --- a/console/src/main/resources/static/src/pages/ConfigurationManagement/NewConfig/index.js +++ b/console/src/main/resources/static/src/pages/ConfigurationManagement/NewConfig/index.js @@ -13,4 +13,4 @@ import NewConfig from './NewConfig'; -export default NewConfig; \ No newline at end of file +export default NewConfig; diff --git a/console/src/main/resources/static/src/pages/NameSpace/NameSpace.js b/console/src/main/resources/static/src/pages/NameSpace/NameSpace.js index 793e1106c..a361eae77 100644 --- a/console/src/main/resources/static/src/pages/NameSpace/NameSpace.js +++ b/console/src/main/resources/static/src/pages/NameSpace/NameSpace.js @@ -20,273 +20,347 @@ import EditorNameSpace from '../../components/EditorNameSpace'; import { getParams, setParams, request, aliwareIntl } from '../../globalLib'; import './index.less'; -/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/ class NameSpace extends React.Component { - constructor(props) { - super(props); - this.state = { - loading: false, - defaultNamespace: "", - dataSource: [] + constructor(props) { + super(props); + this.state = { + loading: false, + defaultNamespace: '', + dataSource: [], + }; + } - }; - } + componentDidMount() { + this.getNameSpaces(0); + } - componentDidMount() { - this.getNameSpaces(0); - } - getNameSpaces(delayTime = 2000) { - let self = this; - // let serverId = getParams('serverId') || 'center'; - self.openLoading(); - setTimeout(() => { - request({ - type: 'get', - beforeSend: function () { }, - url: `/nacos/v1/console/namespaces`, - success: res => { - if (res.code === 200) { - let data = res.data || []; - window.namespaceList = data; + getNameSpaces(delayTime = 2000) { + const self = this; + // let serverId = getParams('serverId') || 'center'; + self.openLoading(); + setTimeout(() => { + request({ + type: 'get', + beforeSend() {}, + url: '/nacos/v1/console/namespaces', + success: res => { + if (res.code === 200) { + const data = res.data || []; + window.namespaceList = data; - for (var i = 0; i < data.length; i++) { - if (data[i].type === 1) { - this.setState({ - defaultNamespace: data[i].namespace - }); - } - } - - this.setState({ - dataSource: data - }); - } else { - Dialog.alert({ - language: aliwareIntl.currentLanguageCode || 'zh-cn', - title: aliwareIntl.get('com.alibaba.nacos.page.namespace.prompt'), - content: res.message - }); - } - }, - complete: function () { - self.closeLoading(); - }, - error: res => { - window.namespaceList = [{ - "namespace": "", - "namespaceShowName": "公共空间", - "type": 0 - }]; - } - }); - }, delayTime); - } - - openLoading() { - this.setState({ - loading: true - }); - } - closeLoading() { - this.setState({ - loading: false - }); - } - - detailNamespace(record) { - let namespace = record.namespace; //获取ak,sk - request({ - url: `/nacos/v1/console/namespaces?show=all&namespaceId=${namespace}`, - beforeSend: () => { - this.openLoading(); - }, - success: res => { - if (res !== null) { - Dialog.alert({ - style: { width: "500px" }, - needWrapper: false, - language: aliwareIntl.currentLanguageCode || 'zh-cn', - title: aliwareIntl.get('nacos.page.namespace.Namespace_details'), - content:
    -
    -

    - {aliwareIntl.get('nacos.page.namespace.namespace_name')} - - {res.namespaceShowName} - -

    -

    - {aliwareIntl.get('nacos.page.namespace.namespace_ID')} - - {res.namespace} - -

    -

    - {aliwareIntl.get('com.alibaba.nacos.page.namespace.configuration')} - - {res.configCount} / {res.quota} - -

    -

    - {aliwareIntl.get('nacos.page.configdetail.Description')} - - {res.namespaceDesc} - -

    -
    -
    - }); - } - }, - complete: () => { - this.closeLoading(); - } - }); - } - - removeNamespace(record) { - // let serverId = getParams('serverId') || 'center'; - Dialog.confirm({ - title: aliwareIntl.get('nacos.page.namespace.remove_the_namespace'), - content:
    -

    {aliwareIntl.get('nacos.page.namespace.sure_you_want_to_delete_the_following_namespaces?')}

    -

    - {aliwareIntl.get('nacos.page.namespace.namespace_name')} - - {record.namespaceShowName} - -

    -

    - {aliwareIntl.get('nacos.page.namespace.namespace_ID')} - - {record.namespace} - -

    -
    , - language: aliwareIntl.currentLanguageCode || 'zh-cn', - onOk: () => { - let url = `/nacos/v1/console/namespaces?namespaceId=${record.namespace}`; - request({ - url: url, - type: 'delete', - success: res => { - let _payload = {}; - _payload.title = aliwareIntl.get('com.alibaba.nacos.page.configurationManagement.configuration_management'); - if (res === true) { - let 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') - }); - } else { - Dialog.confirm({ - language: aliwareIntl.currentLanguageCode || 'zh-cn', - content: res.message, - title: "删除失败" - }); - } - - this.getNameSpaces(); - } + for (let i = 0; i < data.length; i++) { + if (data[i].type === 1) { + this.setState({ + defaultNamespace: data[i].namespace, }); + } } - }); - } - refreshNameSpace() { - request({ - type: 'get', - url: `/nacos/v1/console/namespaces`, - success: res => { - if (res.code === 200) { - window.namespaceList = res.data; - } + this.setState({ + dataSource: data, + }); + } else { + Dialog.alert({ + language: aliwareIntl.currentLanguageCode || 'zh-cn', + title: aliwareIntl.get('com.alibaba.nacos.page.namespace.prompt'), + content: res.message, + }); + } + }, + complete() { + self.closeLoading(); + }, + error: res => { + window.namespaceList = [ + { + namespace: '', + namespaceShowName: '公共空间', + type: 0, }, - error: res => { - window.namespaceList = [{ - "namespace": "", - "namespaceShowName": "公共空间", - "type": 0 - }];; + ]; + }, + }); + }, delayTime); + } + + openLoading() { + this.setState({ + loading: true, + }); + } + + closeLoading() { + this.setState({ + loading: false, + }); + } + + detailNamespace(record) { + const { namespace } = record; // 获取ak,sk + request({ + url: `/nacos/v1/console/namespaces?show=all&namespaceId=${namespace}`, + beforeSend: () => { + this.openLoading(); + }, + success: res => { + if (res !== null) { + Dialog.alert({ + style: { width: '500px' }, + needWrapper: false, + language: aliwareIntl.currentLanguageCode || 'zh-cn', + title: aliwareIntl.get('nacos.page.namespace.Namespace_details'), + content: ( +
    +
    +

    + + {aliwareIntl.get('nacos.page.namespace.namespace_name')} + + {res.namespaceShowName} +

    +

    + + {aliwareIntl.get('nacos.page.namespace.namespace_ID')} + + {res.namespace} +

    +

    + + {aliwareIntl.get('com.alibaba.nacos.page.namespace.configuration')} + + + {res.configCount} / {res.quota} + +

    +

    + + {aliwareIntl.get('nacos.page.configdetail.Description')} + + {res.namespaceDesc} +

    +
    +
    + ), + }); + } + }, + complete: () => { + this.closeLoading(); + }, + }); + } + + removeNamespace(record) { + // let serverId = getParams('serverId') || 'center'; + Dialog.confirm({ + title: aliwareIntl.get('nacos.page.namespace.remove_the_namespace'), + content: ( +
    +

    + {aliwareIntl.get( + 'nacos.page.namespace.sure_you_want_to_delete_the_following_namespaces?' + )} +

    +

    + + {aliwareIntl.get('nacos.page.namespace.namespace_name')} + + {record.namespaceShowName} +

    +

    + + {aliwareIntl.get('nacos.page.namespace.namespace_ID')} + + {record.namespace} +

    +
    + ), + language: aliwareIntl.currentLanguageCode || 'zh-cn', + onOk: () => { + const url = `/nacos/v1/console/namespaces?namespaceId=${record.namespace}`; + request({ + url, + type: 'delete', + success: res => { + const _payload = {}; + _payload.title = aliwareIntl.get( + 'com.alibaba.nacos.page.configurationManagement.configuration_management' + ); + 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'), + }); + } else { + Dialog.confirm({ + language: aliwareIntl.currentLanguageCode || 'zh-cn', + content: res.message, + title: '删除失败', + }); } + + this.getNameSpaces(); + }, }); - } + }, + }); + } - openToEdit(record) { - this.refs['editgroup'].openDialog(record); - } - renderOption(value, index, record) { - let _delinfo = {aliwareIntl.get('com.alibaba.nacos.page.namespace.delete')}; - if (record.type === 1 || record.type === 0) { - _delinfo = {aliwareIntl.get('com.alibaba.nacos.page.namespace.delete')}; + refreshNameSpace() { + request({ + type: 'get', + url: '/nacos/v1/console/namespaces', + success: res => { + if (res.code === 200) { + window.namespaceList = res.data; } - let _detailinfo = {aliwareIntl.get('nacos.page.namespace.details')}; + }, + error: res => { + window.namespaceList = [ + { + namespace: '', + namespaceShowName: '公共空间', + type: 0, + }, + ]; + }, + }); + } - let _editinfo = {aliwareIntl.get('com.alibaba.nacos.page.namespace.edit')}; - if (record.type === 0 || record.type === 1) { - _editinfo = {aliwareIntl.get('com.alibaba.nacos.page.namespace.edit')}; - } - return
    - {_detailinfo} - {_delinfo} - {_editinfo} -
    ; + openToEdit(record) { + this.refs.editgroup.openDialog(record); + } + + renderOption(value, index, record) { + let _delinfo = ( + + {aliwareIntl.get('com.alibaba.nacos.page.namespace.delete')} + + ); + if (record.type === 1 || record.type === 0) { + _delinfo = ( + + {aliwareIntl.get('com.alibaba.nacos.page.namespace.delete')} + + ); } - addNameSpace() { - this.refs['newnamespace'].openDialog(this.state.dataSource); + const _detailinfo = ( + + {aliwareIntl.get('nacos.page.namespace.details')} + + ); + + let _editinfo = ( + + {aliwareIntl.get('com.alibaba.nacos.page.namespace.edit')} + + ); + if (record.type === 0 || record.type === 1) { + _editinfo = ( + + {aliwareIntl.get('com.alibaba.nacos.page.namespace.edit')} + + ); } - renderName(value, index, record) { + return ( +
    + {_detailinfo} + {_delinfo} + {_editinfo} +
    + ); + } - let name = record.namespaceShowName; - if (record.type === 0) { - name = aliwareIntl.get('com.alibaba.nacos.page.namespace.public'); - } - return
    {name}
    ; + addNameSpace() { + this.refs.newnamespace.openDialog(this.state.dataSource); + } + + renderName(value, index, record) { + let name = record.namespaceShowName; + if (record.type === 0) { + name = aliwareIntl.get('com.alibaba.nacos.page.namespace.public'); } - renderConfigCount(value, index, record) { - return
    {value} / {record.quota}
    ; - } - render() { - const pubnodedata = aliwareIntl.get('pubnodata'); + return
    {name}
    ; + } - const locale = { - empty: pubnodedata - }; - return
    - -
    - -
    -
    + renderConfigCount(value, index, record) { + return ( +
    + {value} / {record.quota} +
    + ); + } - -
    -
    - - - - + render() { + const pubnodedata = aliwareIntl.get('pubnodata'); - -
    -
    -
    + const locale = { + empty: pubnodedata, + }; + return ( +
    + +
    + +
    +
    + +
    +
    + + + + - - - - + +
    +
    - - - -
    ; - } + + + + +
    +
    + ); + } } -/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/ -export default NameSpace; \ No newline at end of file + +export default NameSpace; diff --git a/console/src/main/resources/static/src/pages/NameSpace/index.js b/console/src/main/resources/static/src/pages/NameSpace/index.js index 74adf3045..b99ba6ece 100644 --- a/console/src/main/resources/static/src/pages/NameSpace/index.js +++ b/console/src/main/resources/static/src/pages/NameSpace/index.js @@ -13,4 +13,4 @@ import NameSpace from './NameSpace'; -export default NameSpace; \ No newline at end of file +export default NameSpace; diff --git a/console/src/main/resources/static/src/pages/ServiceManagement/ServiceDetail/EditClusterDialog.js b/console/src/main/resources/static/src/pages/ServiceManagement/ServiceDetail/EditClusterDialog.js index 2c2804a63..c0f0aa090 100644 --- a/console/src/main/resources/static/src/pages/ServiceManagement/ServiceDetail/EditClusterDialog.js +++ b/console/src/main/resources/static/src/pages/ServiceManagement/ServiceDetail/EditClusterDialog.js @@ -14,156 +14,161 @@ 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 { I18N, DIALOG_FORM_LAYOUT } from './constant'; -const FormItem = Form.Item; -const Option = Select.Option - -/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/ class EditClusterDialog extends React.Component { - constructor(props) { - super(props); - this.state = { - editCluster: {}, - editClusterDialogVisible: false + constructor(props) { + super(props); + this.state = { + editCluster: {}, + editClusterDialogVisible: false, + }; + this.show = this.show.bind(this); + } + + show(_editCluster) { + let editCluster = _editCluster; + const { metadata = {} } = editCluster; + editCluster.metadataText = Object.keys(metadata) + .map(k => `${k}=${metadata[k]}`) + .join(','); + this.setState({ + editCluster, + editClusterDialogVisible: true, + }); + } + + hide() { + this.setState({ editClusterDialogVisible: false }); + } + + onConfirm() { + const { openLoading, closeLoading, getServiceDetail } = this.props; + const { + name, + serviceName, + metadataText, + defaultCheckPort, + useIPPort4Check, + healthChecker, + } = this.state.editCluster; + request({ + method: 'POST', + url: '/nacos/v1/ns/cluster/update', + data: { + serviceName, + clusterName: name, + metadata: metadataText, + checkPort: defaultCheckPort, + useInstancePort4Check: useIPPort4Check, + healthChecker: JSON.stringify(healthChecker), + }, + dataType: 'text', + beforeSend: () => openLoading(), + success: res => { + if (res !== 'ok') { + Message.error(res); + return; } - this.show = this.show.bind(this) - } + this.hide(); + getServiceDetail(); + }, + complete: () => closeLoading(), + }); + } - show(editCluster) { - const { metadata = {} } = editCluster - editCluster.metadataText = Object.keys(metadata).map(k => `${k}=${metadata[k]}`).join(',') - this.setState({ - editCluster, - editClusterDialogVisible: true - }) - } + onChangeCluster(changeVal) { + const { editCluster = {} } = this.state; + this.setState({ + editCluster: Object.assign({}, editCluster, changeVal), + }); + } - hide() { - this.setState({ editClusterDialogVisible: false }) - } - - onConfirm() { - const { openLoading, closeLoading, getServiceDetail } = this.props - const { name, serviceName, metadataText, defaultCheckPort, useIPPort4Check, healthChecker } = this.state.editCluster - request({ - method: 'POST', - url: '/nacos/v1/ns/cluster/update', - data: { - serviceName, - clusterName: name, - metadata: metadataText, - checkPort: defaultCheckPort, - useInstancePort4Check: useIPPort4Check, - healthChecker: JSON.stringify(healthChecker) - }, - dataType: 'text', - beforeSend: () => openLoading(), - success: res => { - if (res !== 'ok') { - Message.error(res) - return - } - this.hide() - getServiceDetail() - }, - complete: () => closeLoading() - }) - } - - onChangeCluster(changeVal) { - const { editCluster = {} } = this.state - this.setState({ - editCluster: Object.assign({}, editCluster, changeVal) - }) - } - - render() { - const { editCluster = {}, editClusterDialogVisible } = this.state - const { - healthChecker = {}, - useIPPort4Check, - defaultCheckPort = '80', - metadataText = '' - } = editCluster - const { type, path, headers } = healthChecker - const healthCheckerChange = changeVal => this.onChangeCluster({ - healthChecker: Object.assign({}, healthChecker, changeVal) - }) - return ( - this.onConfirm()} - onCancel={() => this.hide()} - onClose={() => this.hide()} + render() { + const { editCluster = {}, editClusterDialogVisible } = this.state; + const { + healthChecker = {}, + useIPPort4Check, + defaultCheckPort = '80', + metadataText = '', + } = editCluster; + const { type, path, headers } = healthChecker; + const healthCheckerChange = changeVal => + this.onChangeCluster({ + healthChecker: Object.assign({}, healthChecker, changeVal), + }); + return ( + this.onConfirm()} + onCancel={() => this.hide()} + onClose={() => this.hide()} + > +
    + + healthCheckerChange({ type })} - > - - - - - - this.onChangeCluster({ defaultCheckPort })} - /> - - - this.onChangeCluster({ useIPPort4Check })} - /> - - { - type === 'HTTP' - ? (
    -
    -
    - -
    -
    - healthCheckerChange({ path })} - /> -
    -
    -
    -
    - -
    -
    - healthCheckerChange({ headers })} - /> -
    -
    -
    ) - : null - } - - this.onChangeCluster({ metadataText })} - /> - - -
    - ) - } + TCP + HTTP + + + + this.onChangeCluster({ defaultCheckPort })} + /> + + + this.onChangeCluster({ useIPPort4Check })} + /> + + {type === 'HTTP' ? ( +
    +
    +
    + +
    +
    + healthCheckerChange({ path })} + /> +
    +
    +
    +
    + +
    +
    + healthCheckerChange({ headers })} + /> +
    +
    +
    + ) : null} + + this.onChangeCluster({ metadataText })} + /> + + +
    + ); + } } -/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/ export default EditClusterDialog; diff --git a/console/src/main/resources/static/src/pages/ServiceManagement/ServiceDetail/EditInstanceDialog.js b/console/src/main/resources/static/src/pages/ServiceManagement/ServiceDetail/EditInstanceDialog.js index a1cd34773..4c29bc6e8 100644 --- a/console/src/main/resources/static/src/pages/ServiceManagement/ServiceDetail/EditInstanceDialog.js +++ b/console/src/main/resources/static/src/pages/ServiceManagement/ServiceDetail/EditInstanceDialog.js @@ -14,103 +14,103 @@ import React from 'react'; import { request } from '../../../globalLib'; import { Dialog, Form, Input, Switch, Message } from '@alifd/next'; -import { I18N, DIALOG_FORM_LAYOUT } from './constant' +import { I18N, DIALOG_FORM_LAYOUT } from './constant'; -const FormItem = Form.Item; - -/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/ class EditInstanceDialog extends React.Component { - constructor(props) { - super(props); - this.state = { - editInstance: {}, - editInstanceDialogVisible: false + constructor(props) { + super(props); + this.state = { + editInstance: {}, + editInstanceDialogVisible: false, + }; + this.show = this.show.bind(this); + } + + show(_editInstance) { + let editInstance = _editInstance; + const { metadata = {} } = editInstance; + if (Object.keys(metadata).length) { + editInstance.metadataText = Object.keys(metadata) + .map(k => `${k}=${metadata[k]}`) + .join(','); + } + this.setState({ editInstance, editInstanceDialogVisible: true }); + } + + hide() { + this.setState({ editInstanceDialogVisible: false }); + } + + onConfirm() { + const { serviceName, clusterName, getInstanceList, openLoading, closeLoading } = this.props; + const { ip, port, weight, enabled, metadataText } = this.state.editInstance; + request({ + method: 'POST', + url: '/nacos/v1/ns/instance/update', + data: { serviceName, clusterName, ip, port, weight, enable: enabled, metadata: metadataText }, + dataType: 'text', + beforeSend: () => openLoading(), + success: res => { + if (res !== 'ok') { + Message.error(res); + return; } - this.show = this.show.bind(this) - } + this.hide(); + getInstanceList(); + }, + complete: () => closeLoading(), + }); + } - show(editInstance) { - const { metadata = {} } = editInstance - if (Object.keys(metadata).length) { - editInstance.metadataText = Object.keys(metadata).map(k => `${k}=${metadata[k]}`).join(',') - } - this.setState({ editInstance, editInstanceDialogVisible: true }) - } + onChangeCluster(changeVal) { + const { editInstance = {} } = this.state; + this.setState({ + editInstance: Object.assign({}, editInstance, changeVal), + }); + } - hide() { - this.setState({ editInstanceDialogVisible: false }) - } - - onConfirm() { - const { serviceName, clusterName, getInstanceList, openLoading, closeLoading } = this.props - const { ip, port, weight, enabled, metadataText } = this.state.editInstance - request({ - method: 'POST', - url: '/nacos/v1/ns/instance/update', - data: { serviceName, clusterName, ip, port, weight, enable: enabled, metadata: metadataText }, - dataType: 'text', - beforeSend: () => openLoading(), - success: res => { - if (res !== 'ok') { - Message.error(res) - return - } - this.hide() - getInstanceList() - }, - complete: () => closeLoading() - }) - } - - onChangeCluster(changeVal) { - const { editInstance = {} } = this.state - this.setState({ - editInstance: Object.assign({}, editInstance, changeVal) - }) - } - - render() { - const { editInstanceDialogVisible, editInstance } = this.state - return ( - this.onConfirm()} - onCancel={() => this.hide()} - onClose={() => this.hide()} - > -
    - -

    {editInstance.ip}

    -
    - -

    {editInstance.port}

    -
    - - this.onChangeCluster({ weight })} - /> - - - this.onChangeCluster({ enabled })} /> - - - this.onChangeCluster({ metadataText })} - /> - -
    -
    - ) - } + render() { + const { editInstanceDialogVisible, editInstance } = this.state; + return ( + this.onConfirm()} + onCancel={() => this.hide()} + onClose={() => this.hide()} + > +
    + +

    {editInstance.ip}

    +
    + +

    {editInstance.port}

    +
    + + this.onChangeCluster({ weight })} + /> + + + this.onChangeCluster({ enabled })} + /> + + + this.onChangeCluster({ metadataText })} + /> + +
    +
    + ); + } } -/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/ export default EditInstanceDialog; diff --git a/console/src/main/resources/static/src/pages/ServiceManagement/ServiceDetail/EditServiceDialog.js b/console/src/main/resources/static/src/pages/ServiceManagement/ServiceDetail/EditServiceDialog.js index dc04e2cea..e0248973d 100644 --- a/console/src/main/resources/static/src/pages/ServiceManagement/ServiceDetail/EditServiceDialog.js +++ b/console/src/main/resources/static/src/pages/ServiceManagement/ServiceDetail/EditServiceDialog.js @@ -12,130 +12,123 @@ */ import React from 'react'; -import {request} from '../../../globalLib'; -import {Dialog, Form, Input, Select, Message} from '@alifd/next'; -import {I18N, DIALOG_FORM_LAYOUT} from './constant' +import { request } from '../../../globalLib'; +import { Dialog, Form, Input, Select, Message } from '@alifd/next'; +import { I18N, DIALOG_FORM_LAYOUT } from './constant'; -const FormItem = Form.Item; -const Option = Select.Option - -/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/ class EditServiceDialog extends React.Component { - constructor(props) { - super(props); - this.state = { - isCreate: false, - editService: {}, - editServiceDialogVisible: false + constructor(props) { + super(props); + this.state = { + isCreate: false, + editService: {}, + editServiceDialogVisible: false, + }; + this.show = this.show.bind(this); + } + + show(_editService = {}) { + let editService = _editService; + const { metadata = {}, name } = editService; + if (Object.keys(metadata).length) { + editService.metadataText = Object.keys(metadata) + .map(k => `${k}=${metadata[k]}`) + .join(','); + } + this.setState({ editService, editServiceDialogVisible: true, isCreate: !name }); + } + + hide() { + this.setState({ editServiceDialogVisible: false }); + } + + onConfirm() { + const { isCreate } = this.state; + const editService = Object.assign({}, this.state.editService); + const { name, protectThreshold, healthCheckMode, metadataText } = editService; + request({ + method: isCreate ? 'PUT' : 'POST', + url: `/nacos/v1/ns/service/${isCreate ? 'create' : 'update'}`, + data: { serviceName: name, protectThreshold, healthCheckMode, metadata: metadataText }, + dataType: 'text', + beforeSend: () => this.setState({ loading: true }), + success: res => { + if (res !== 'ok') { + Message.error(res); + return; } - this.show = this.show.bind(this) - } - - show(editService = {}) { - const {metadata = {}, name} = editService - if (Object.keys(metadata).length) { - editService.metadataText = Object.keys(metadata).map(k => `${k}=${metadata[k]}`).join(',') + if (isCreate) { + this.props.queryServiceList(); + } else { + this.props.getServiceDetail(); } - this.setState({editService, editServiceDialogVisible: true, isCreate: !name}) - } + }, + error: res => Message.error(res.responseText || res.statusText), + complete: () => this.setState({ loading: false }), + }); + this.hide(); + } - hide() { - this.setState({editServiceDialogVisible: false}) - } + onChangeCluster(changeVal) { + const { editService = {} } = this.state; + this.setState({ + editService: Object.assign({}, editService, changeVal), + }); + } - onConfirm() { - const {isCreate} = this.state - const editService = Object.assign({}, this.state.editService) - const {name, protectThreshold, healthCheckMode, metadataText} = editService - request({ - method: isCreate ? 'PUT' : 'POST', - url: `/nacos/v1/ns/service/${isCreate ? 'create' : 'update'}`, - data: {serviceName: name, protectThreshold, healthCheckMode, metadata: metadataText}, - dataType: 'text', - beforeSend: () => this.setState({loading: true}), - success: res => { - if (res !== 'ok') { - Message.error(res) - return - } - if (isCreate) { - this.props.queryServiceList() - } else { - this.props.getServiceDetail() - } - }, - error: res => Message.error(res.responseText || res.statusText), - complete: () => this.setState({loading: false}) - }) - this.hide() - } - - onChangeCluster(changeVal) { - const {editService = {}} = this.state - this.setState({ - editService: Object.assign({}, editService, changeVal) - }) - } - - render() { - const {isCreate, editService, editServiceDialogVisible} = this.state - const { - name, - protectThreshold, - healthCheckMode, - metadataText - } = editService - return ( - this.onConfirm()} - onCancel={() => this.hide()} - onClose={() => this.hide()} + render() { + const { isCreate, editService, editServiceDialogVisible } = this.state; + const { name, protectThreshold, healthCheckMode, metadataText } = editService; + return ( + this.onConfirm()} + onCancel={() => this.hide()} + onClose={() => this.hide()} + > +
    + + {!isCreate ? ( +

    {name}

    + ) : ( + this.onChangeCluster({ name })} + /> + )} +
    + + this.onChangeCluster({ protectThreshold })} + /> + + + this.onChangeCluster({name})} - /> - } - - - this.onChangeCluster({protectThreshold})} - /> - - - - - - this.onChangeCluster({metadataText})} - /> - - -
    - ) - } + {I18N.HEALTH_CHECK_PATTERN_SERVICE} + {I18N.HEALTH_CHECK_PATTERN_CLIENT} + {I18N.HEALTH_CHECK_PATTERN_NONE} + + + + this.onChangeCluster({ metadataText })} + /> + + +
    + ); + } } -/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/ export default EditServiceDialog; diff --git a/console/src/main/resources/static/src/pages/ServiceManagement/ServiceDetail/InstanceTable.js b/console/src/main/resources/static/src/pages/ServiceManagement/ServiceDetail/InstanceTable.js index d47bd0052..aa110e88c 100644 --- a/console/src/main/resources/static/src/pages/ServiceManagement/ServiceDetail/InstanceTable.js +++ b/console/src/main/resources/static/src/pages/ServiceManagement/ServiceDetail/InstanceTable.js @@ -12,137 +12,150 @@ */ import React from 'react'; +import PropTypes from 'prop-types'; import { request } from '../../../globalLib'; import { Button, Pagination, Table } from '@alifd/next'; -import { I18N, HEALTHY_COLOR_MAPPING } from './constant' -import EditInstanceDialog from "./EditInstanceDialog"; +import { I18N, HEALTHY_COLOR_MAPPING } from './constant'; +import EditInstanceDialog from './EditInstanceDialog'; - -/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/ class InstanceTable extends React.Component { - constructor(props) { - super(props); - this.state = { - loading: false, - instance: { count: 0, list: [] }, - pageNum: 1, - pageSize: 10 - } - } + static propTypes = { + clusterName: PropTypes.string, + serviceName: PropTypes.string, + }; - componentDidMount() { - this.getInstanceList() - } + constructor(props) { + super(props); + this.state = { + loading: false, + instance: { count: 0, list: [] }, + pageNum: 1, + pageSize: 10, + }; + } - openLoading() { - this.setState({ loading: true }) - } + componentDidMount() { + this.getInstanceList(); + } - closeLoading() { - this.setState({ loading: false }) - } + openLoading() { + this.setState({ loading: true }); + } - getInstanceList() { - const { clusterName, serviceName } = this.props - if (!clusterName) return - const { pageSize, pageNum } = this.state - request({ - url: '/nacos/v1/ns/catalog/instanceList', - data: { - serviceName, - clusterName, - pgSize: pageSize, - startPg: pageNum - }, - beforeSend: () => this.openLoading(), - success: instance => this.setState({ instance }), - complete: () => this.closeLoading() - }) - } + closeLoading() { + this.setState({ loading: false }); + } - openInstanceDialog(instance) { - this.refs.editInstanceDialog.show(instance) - } + getInstanceList() { + const { clusterName, serviceName } = this.props; + if (!clusterName) return; + const { pageSize, pageNum } = this.state; + request({ + url: '/nacos/v1/ns/catalog/instanceList', + data: { + serviceName, + clusterName, + pgSize: pageSize, + startPg: pageNum, + }, + beforeSend: () => this.openLoading(), + success: instance => this.setState({ instance }), + complete: () => this.closeLoading(), + }); + } - switchState(index, record) { - const { instance } = this.state - const { ip, port, weight, enabled } = record - const { clusterName, serviceName } = this.props - const newVal = Object.assign({}, instance) - newVal.list[index]['enabled'] = !enabled - request({ - method: 'POST', - url: '/nacos/v1/ns/instance/update', - data: { serviceName, clusterName, ip, port, weight, enable: !enabled }, - dataType: 'text', - beforeSend: () => this.openLoading(), - success: () => this.setState({ instance: newVal }), - complete: () => this.closeLoading() - }) - } + openInstanceDialog(instance) { + this.refs.editInstanceDialog.show(instance); + } - onChangePage(pageNum) { - this.setState({ pageNum }, () => this.getInstanceList()) - } + switchState(index, record) { + const { instance } = this.state; + const { ip, port, weight, enabled } = record; + const { clusterName, serviceName } = this.props; + const newVal = Object.assign({}, instance); + newVal.list[index].enabled = !enabled; + request({ + method: 'POST', + url: '/nacos/v1/ns/instance/update', + data: { serviceName, clusterName, ip, port, weight, enable: !enabled }, + dataType: 'text', + beforeSend: () => this.openLoading(), + success: () => this.setState({ instance: newVal }), + complete: () => this.closeLoading(), + }); + } - rowColor = ({ healthy }) => ({ className: `row-bg-${HEALTHY_COLOR_MAPPING[`${healthy}`]}` }) + onChangePage(pageNum) { + this.setState({ pageNum }, () => this.getInstanceList()); + } - render() { - const { clusterName, serviceName } = this.props - const { instance, pageSize, loading } = this.state - return instance.count ? ( -
    - - - - - `${val}`} /> - Object.keys(metadata).map(k => `${k}=${metadata[k]}`).join(',')} - /> - ( -
    - - -
    - )} /> -
    - { - instance.count > pageSize - ? ( - this.onChangePage(currentPage)} - /> - ) - : null - } - this.openLoading()} - closeLoading={() => this.closeLoading()} - getInstanceList={() => this.getInstanceList()} - /> -
    - ) : null - } + rowColor = ({ healthy }) => ({ className: `row-bg-${HEALTHY_COLOR_MAPPING[`${healthy}`]}` }); + + render() { + const { clusterName, serviceName } = this.props; + const { instance, pageSize, loading } = this.state; + return instance.count ? ( +
    + + + + + `${val}`} + /> + + Object.keys(metadata) + .map(k => `${k}=${metadata[k]}`) + .join(',') + } + /> + ( +
    + + +
    + )} + /> +
    + {instance.count > pageSize ? ( + this.onChangePage(currentPage)} + /> + ) : null} + this.openLoading()} + closeLoading={() => this.closeLoading()} + getInstanceList={() => this.getInstanceList()} + /> +
    + ) : null; + } } -/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/ export default InstanceTable; diff --git a/console/src/main/resources/static/src/pages/ServiceManagement/ServiceDetail/ServiceDetail.js b/console/src/main/resources/static/src/pages/ServiceManagement/ServiceDetail/ServiceDetail.js index cc82bd41f..d2aa0427e 100644 --- a/console/src/main/resources/static/src/pages/ServiceManagement/ServiceDetail/ServiceDetail.js +++ b/console/src/main/resources/static/src/pages/ServiceManagement/ServiceDetail/ServiceDetail.js @@ -14,152 +14,153 @@ import React from 'react'; import { request } from '../../../globalLib'; import { Button, Card, Form, Loading } from '@alifd/next'; -import EditServiceDialog from './EditServiceDialog' -import EditClusterDialog from './EditClusterDialog' -import InstanceTable from './InstanceTable' -import queryString from 'query-string' -import { I18N } from './constant' -import './ServiceDetail.less' +import EditServiceDialog from './EditServiceDialog'; +import EditClusterDialog from './EditClusterDialog'; +import InstanceTable from './InstanceTable'; +import queryString from 'query-string'; +import { I18N } from './constant'; +import './ServiceDetail.less'; const FormItem = Form.Item; const pageFormLayout = { - labelCol: { fixedSpan: 10 }, - wrapperCol: { span: 14 } + labelCol: { fixedSpan: 10 }, + wrapperCol: { span: 14 }, }; -/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/ + class ServiceDetail extends React.Component { - constructor(props) { - super(props); - this.state = { - serviceName: queryString.parse(props.location.search).name, - loading: false, - currentPage: 1, - clusters: [], - instances: {}, - service: {}, - pageSize: 10, - pageNum: {} - } + constructor(props) { + super(props); + this.state = { + serviceName: queryString.parse(props.location.search).name, + loading: false, + currentPage: 1, + clusters: [], + instances: {}, + service: {}, + pageSize: 10, + pageNum: {}, + }; + } + + componentDidMount() { + if (!this.state.serviceName) { + this.props.history.goBack(); + return; } + this.getServiceDetail(); + } - componentDidMount() { - if (!this.state.serviceName) { - this.props.history.goBack() - return - } - this.getServiceDetail() - } + getServiceDetail() { + const { serviceName } = this.state; + request({ + url: `/nacos/v1/ns/catalog/serviceDetail?serviceName=${serviceName}`, + beforeSend: () => this.openLoading(), + success: ({ clusters = [], service = {} }) => this.setState({ service, clusters }), + complete: () => this.closeLoading(), + }); + } - getServiceDetail() { - const { serviceName } = this.state - request({ - url: `/nacos/v1/ns/catalog/serviceDetail?serviceName=${serviceName}`, - beforeSend: () => this.openLoading(), - success: ({ clusters = [], service = {} }) => this.setState({ service, clusters }), - complete: () => this.closeLoading() - }) - } + openLoading() { + this.setState({ loading: true }); + } - openLoading() { - this.setState({ loading: true }) - } + closeLoading() { + this.setState({ loading: false }); + } - closeLoading() { - this.setState({ loading: false }) - } + openEditServiceDialog() { + this.refs.editServiceDialog.show(this.state.service); + } - openEditServiceDialog() { - this.refs.editServiceDialog.show(this.state.service) - } + openClusterDialog(cluster) { + this.refs.editClusterDialog.show(cluster); + } - openClusterDialog(cluster) { - this.refs.editClusterDialog.show(cluster) - } + render() { + const { serviceName, loading, service = {}, clusters } = this.state; + const { metadata = {} } = service; + const metadataText = Object.keys(metadata).map(key => `${key}=${metadata[key]}`).join(','); + return ( +
    + +

    + {I18N.SERVICE_DETAILS} + + +

    - render() { - const { serviceName, loading, service = {}, clusters } = this.state - const { metadata = {} } = service - const metadataText = Object.keys(metadata).map(key => `${key}=${metadata[key]}`).join(',') - return ( -
    - -

    - {I18N.SERVICE_DETAILS} - - -

    - -
    - -

    {service.name}

    -
    - -

    {service.protectThreshold}

    -
    - -

    {service.healthCheckMode}

    -
    - -

    {metadataText}

    -
    -
    - { +
    + +

    {service.name}

    +
    + +

    {service.protectThreshold}

    +
    + +

    {service.healthCheckMode}

    +
    + +

    {metadataText}

    +
    +
    + { clusters.map(cluster => ( - this.openClusterDialog(cluster)} - >{I18N.EDIT_CLUSTER} + this.openClusterDialog(cluster)} + >{I18N.EDIT_CLUSTER} )} - > - - + > + + )) } -
    - this.openLoading()} - closeLoading={() => this.closeLoading()} - getServiceDetail={() => this.getServiceDetail()} - /> - this.openLoading()} - closeLoading={() => this.closeLoading()} - getServiceDetail={() => this.getServiceDetail()} - /> -
    - ); - } +
    + this.openLoading()} + closeLoading={() => this.closeLoading()} + getServiceDetail={() => this.getServiceDetail()} + /> + this.openLoading()} + closeLoading={() => this.closeLoading()} + getServiceDetail={() => this.getServiceDetail()} + /> +
    + ); + } } -/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/ + export default ServiceDetail; diff --git a/console/src/main/resources/static/src/pages/ServiceManagement/ServiceDetail/constant.js b/console/src/main/resources/static/src/pages/ServiceManagement/ServiceDetail/constant.js index b169f4b9c..926dd2c8f 100644 --- a/console/src/main/resources/static/src/pages/ServiceManagement/ServiceDetail/constant.js +++ b/console/src/main/resources/static/src/pages/ServiceManagement/ServiceDetail/constant.js @@ -13,131 +13,131 @@ import { aliwareIntl } from '../../../globalLib'; -const getI18N = (key, prefix = 'com.alibaba.nacos.page.serviceDetail.') => aliwareIntl.get(prefix + key) -export const I18N = {} +const getI18N = (key, prefix = 'com.alibaba.nacos.page.serviceDetail.') => aliwareIntl.get(prefix + key); +export const I18N = {}; /** * 服务列表 */ -I18N.SERVICE_DETAILS = getI18N('service_details') +I18N.SERVICE_DETAILS = getI18N('service_details'); /** * 编辑服务 */ -I18N.EDIT_SERVICE = getI18N('edit_service') +I18N.EDIT_SERVICE = getI18N('edit_service'); /** * 返回 */ -I18N.BACK = getI18N('back') +I18N.BACK = getI18N('back'); /** * 服务名 */ -I18N.SERVICE_NAME = getI18N('service_name') +I18N.SERVICE_NAME = getI18N('service_name'); /** * 保护阀值 */ -I18N.PROTECT_THRESHOLD = getI18N('protect_threshold') +I18N.PROTECT_THRESHOLD = getI18N('protect_threshold'); /** * 健康检查模式 */ -I18N.HEALTH_CHECK_PATTERN = getI18N('health_check_pattern') +I18N.HEALTH_CHECK_PATTERN = getI18N('health_check_pattern'); /** * 健康检查模式 - 服务端 */ -I18N.HEALTH_CHECK_PATTERN_SERVICE = getI18N('health_check_pattern.service') +I18N.HEALTH_CHECK_PATTERN_SERVICE = getI18N('health_check_pattern.service'); /** * 健康检查模式 - 客户端 */ -I18N.HEALTH_CHECK_PATTERN_CLIENT = getI18N('health_check_pattern.client') +I18N.HEALTH_CHECK_PATTERN_CLIENT = getI18N('health_check_pattern.client'); /** * 健康检查模式 - 禁止 */ -I18N.HEALTH_CHECK_PATTERN_NONE = getI18N('health_check_pattern.none') +I18N.HEALTH_CHECK_PATTERN_NONE = getI18N('health_check_pattern.none'); /** * 元数据 */ -I18N.METADATA = getI18N('metadata') +I18N.METADATA = getI18N('metadata'); /** * 更新服务 */ -I18N.UPDATE_SERVICE = getI18N('update_service') +I18N.UPDATE_SERVICE = getI18N('update_service'); /** * 创建服务 */ -I18N.CREATE_SERVICE = getI18N('create_service') +I18N.CREATE_SERVICE = getI18N('create_service'); /** * 集群 */ -I18N.CLUSTER = getI18N('cluster') +I18N.CLUSTER = getI18N('cluster'); /** * 端口 */ -I18N.PORT = getI18N('port') +I18N.PORT = getI18N('port'); /** * 权重 */ -I18N.WEIGHT = getI18N('weight') +I18N.WEIGHT = getI18N('weight'); /** * 健康状态 */ -I18N.HEALTHY = getI18N('healthy') +I18N.HEALTHY = getI18N('healthy'); /** * 操作 */ -I18N.OPERATION = getI18N('operation') +I18N.OPERATION = getI18N('operation'); /** * 编辑 */ -I18N.EDITOR = getI18N('editor') +I18N.EDITOR = getI18N('editor'); /** * 上线 */ -I18N.ONLINE = getI18N('online') +I18N.ONLINE = getI18N('online'); /** * 下线 */ -I18N.OFFLINE = getI18N('offline') +I18N.OFFLINE = getI18N('offline'); /** * 集群配置 */ -I18N.EDIT_CLUSTER = getI18N('edit_cluster') +I18N.EDIT_CLUSTER = getI18N('edit_cluster'); /** * 检查类型 */ -I18N.CHECK_TYPE = getI18N('check_type') +I18N.CHECK_TYPE = getI18N('check_type'); /** * 检查端口 */ -I18N.CHECK_PORT = getI18N('check_port') +I18N.CHECK_PORT = getI18N('check_port'); /** * 使用IP端口检查 */ -I18N.USE_IP_PORT_CHECK = getI18N('use_ip_port_check') +I18N.USE_IP_PORT_CHECK = getI18N('use_ip_port_check'); /** * 检查路径 */ -I18N.CHECK_PATH = getI18N('check_path') +I18N.CHECK_PATH = getI18N('check_path'); /** * 检查头 */ -I18N.CHECK_HEADERS = getI18N('check_headers') +I18N.CHECK_HEADERS = getI18N('check_headers'); /** * 更新集群 */ -I18N.UPDATE_CLUSTER = getI18N('update_cluster') +I18N.UPDATE_CLUSTER = getI18N('update_cluster'); /** * 编辑实例 */ -I18N.UPDATE_INSTANCE = getI18N('update_instance') +I18N.UPDATE_INSTANCE = getI18N('update_instance'); /** * 是否上线 */ -I18N.WHETHER_ONLINE = getI18N('whether_online') +I18N.WHETHER_ONLINE = getI18N('whether_online'); export const DIALOG_FORM_LAYOUT = { - labelCol: { fixedSpan: 12 }, - wrapperCol: { span: 12 } -} + labelCol: { fixedSpan: 12 }, + wrapperCol: { span: 12 }, +}; export const HEALTHY_COLOR_MAPPING = { - 'true': 'green', - 'false': 'red' -} + true: 'green', + false: 'red', +}; diff --git a/console/src/main/resources/static/src/pages/ServiceManagement/ServiceDetail/index.js b/console/src/main/resources/static/src/pages/ServiceManagement/ServiceDetail/index.js index a2c730b3f..69c41cc19 100644 --- a/console/src/main/resources/static/src/pages/ServiceManagement/ServiceDetail/index.js +++ b/console/src/main/resources/static/src/pages/ServiceManagement/ServiceDetail/index.js @@ -11,6 +11,6 @@ * limitations under the License. */ -import ServiceDetail from './ServiceDetail' +import ServiceDetail from './ServiceDetail'; -export default ServiceDetail +export default ServiceDetail; diff --git a/console/src/main/resources/static/src/pages/ServiceManagement/ServiceList/ServiceList.js b/console/src/main/resources/static/src/pages/ServiceManagement/ServiceList/ServiceList.js index e096270ad..ebcac47ae 100644 --- a/console/src/main/resources/static/src/pages/ServiceManagement/ServiceList/ServiceList.js +++ b/console/src/main/resources/static/src/pages/ServiceManagement/ServiceList/ServiceList.js @@ -12,179 +12,205 @@ */ import React from 'react'; +import PropTypes from 'prop-types'; import RegionGroup from '../../../components/RegionGroup/index'; -import {request, aliwareIntl} from '../../../globalLib'; -import {Button, Field, Form, Grid, Input, Loading, Pagination, Table, Dialog, Message} from '@alifd/next'; -import EditServiceDialog from '../ServiceDetail/EditServiceDialog' -import {I18N, STATUS_COLOR_MAPPING} from './constant' -import './ServiceList.less' +import { request, aliwareIntl } from '../../../globalLib'; +import { + Button, + Field, + Form, + Grid, + Input, + Loading, + Pagination, + Table, + Dialog, + Message, +} from '@alifd/next'; +import EditServiceDialog from '../ServiceDetail/EditServiceDialog'; +import { I18N, STATUS_COLOR_MAPPING } from './constant'; +import './ServiceList.less'; const FormItem = Form.Item; -const {Row, Col} = Grid; -const {Column} = Table +const { Row, Col } = Grid; +const { Column } = Table; -/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/ class ServiceList extends React.Component { - constructor(props) { - super(props); - this.state = { - loading: false, - total: 0, - pageSize: 10, - currentPage: 1, - keyword: '', - dataSource: [] - }; - this.field = new Field(this); - } + static propTypes = { + history: PropTypes.object, + }; - openLoading() { - this.setState({loading: true}) - } + constructor(props) { + super(props); + this.state = { + loading: false, + total: 0, + pageSize: 10, + currentPage: 1, + keyword: '', + dataSource: [], + }; + this.field = new Field(this); + } - closeLoading() { - this.setState({loading: false}) - } + openLoading() { + this.setState({ loading: true }); + } - openEditServiceDialog() { - this.refs.editServiceDialog.show(this.state.service) - } + closeLoading() { + this.setState({ loading: false }); + } - queryServiceList() { - const {currentPage, pageSize, keyword} = this.state - const parameter = [`startPg=${currentPage}`, `pgSize=${pageSize}`, `keyword=${keyword}`] + openEditServiceDialog() { + this.refs.editServiceDialog.show(this.state.service); + } + + queryServiceList() { + const { currentPage, pageSize, keyword } = this.state; + const parameter = [`startPg=${currentPage}`, `pgSize=${pageSize}`, `keyword=${keyword}`]; + request({ + url: `/nacos/v1/ns/catalog/serviceList?${parameter.join('&')}`, + beforeSend: () => this.openLoading(), + success: ({ count = 0, serviceList = [] } = {}) => { + this.setState({ + dataSource: serviceList, + total: count, + }); + }, + error: () => + this.setState({ + dataSource: [], + total: 0, + currentPage: 0, + }), + complete: () => this.closeLoading(), + }); + } + + getQueryLater = () => { + setTimeout(() => this.queryServiceList()); + }; + + deleteService(serviceName) { + Dialog.confirm({ + title: I18N.PROMPT, + content: I18N.PROMPT_DELETE, + onOk: () => { request({ - url: `/nacos/v1/ns/catalog/serviceList?${parameter.join('&')}`, - beforeSend: () => this.openLoading(), - success: ({count = 0, serviceList = []} = {}) => this.setState({ - dataSource: serviceList, - total: count - }), - error: () => this.setState({ - dataSource: [], - total: 0, - currentPage: 0 - }), - complete: () => this.closeLoading() - }); - } - - getQueryLater() { - setTimeout(() => this.queryServiceList()); - } - - deleteService(serviceName) { - Dialog.confirm({ - title: I18N.PROMPT, - content: I18N.PROMPT_DELETE, - onOk: () => { - request({ - method: 'DELETE', - url: `/nacos/v1/ns/service/remove?serviceName=${serviceName}`, - dataType: 'text', - beforeSend: () => this.openLoading(), - success: res => { - if (res !== 'ok') { - Message.error(res) - return - } - this.queryServiceList() - }, - error: res => Message.error(res.responseText || res.statusText), - complete: () => this.closeLoading() - }) + method: 'DELETE', + url: `/nacos/v1/ns/service/remove?serviceName=${serviceName}`, + dataType: 'text', + beforeSend: () => this.openLoading(), + success: res => { + if (res !== 'ok') { + Message.error(res); + return; } + this.queryServiceList(); + }, + error: res => Message.error(res.responseText || res.statusText), + complete: () => this.closeLoading(), }); - } + }, + }); + } - rowColor = ({status}) => ({className: `row-bg-${STATUS_COLOR_MAPPING[status]}`}) + rowColor = ({ status }) => ({ className: `row-bg-${STATUS_COLOR_MAPPING[status]}` }); - render() { - const {keyword} = this.state - const {init, getValue} = this.field; - this.init = init; - this.getValue = getValue; - const locale = {empty: I18N.PUBNODEDATA} + render() { + const { keyword } = this.state; + const { init, getValue } = this.field; + this.init = init; + this.getValue = getValue; + const locale = { empty: I18N.PUBNODEDATA }; - return ( -
    - - - - -
    - - this.setState({keyword})} - /> - - - - -
    - -
    - - - this.rowColor(row)} - > - - - - - ( -
    - -
    - )}/> -
    - -
    -
    - this.setState({currentPage}, () => this.queryServiceList())} - language={aliwareIntl.currentLanguageCode} - /> + return ( +
    + + + + +
    + + this.setState({ keyword })} + /> + + + + +
    + +
    + + + this.rowColor(row)} + > + + + + + ( +
    +
    - - this.openLoading()} - closeLoading={() => this.closeLoading()} - queryServiceList={() => this.setState({currentPage: 1}, () => this.queryServiceList())} + )} /> - - ); - } +
    + +
    +
    + + this.setState({ currentPage }, () => this.queryServiceList()) + } + language={aliwareIntl.currentLanguageCode} + /> +
    +
    + this.openLoading()} + closeLoading={() => this.closeLoading()} + queryServiceList={() => this.setState({ currentPage: 1 }, () => this.queryServiceList())} + /> +
    + ); + } } -/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/ export default ServiceList; diff --git a/console/src/main/resources/static/src/pages/ServiceManagement/ServiceList/constant.js b/console/src/main/resources/static/src/pages/ServiceManagement/ServiceList/constant.js index 027d1d01d..0397fb6b6 100644 --- a/console/src/main/resources/static/src/pages/ServiceManagement/ServiceList/constant.js +++ b/console/src/main/resources/static/src/pages/ServiceManagement/ServiceList/constant.js @@ -13,76 +13,76 @@ import { aliwareIntl } from '../../../globalLib'; -const getI18N = (key, prefix = 'com.alibaba.nacos.page.serviceManagement.') => aliwareIntl.get(prefix + key) -export const I18N = {} +const getI18N = (key, prefix = 'com.alibaba.nacos.page.serviceManagement.') => aliwareIntl.get(prefix + key); +export const I18N = {}; /** * 服务列表 */ -I18N.SERVICE_LIST = getI18N('service_list') +I18N.SERVICE_LIST = getI18N('service_list'); /** * 服务名称 */ -I18N.SERVICE_NAME = getI18N('service_name') +I18N.SERVICE_NAME = getI18N('service_name'); /** * 请输入服务名称 */ -I18N.ENTER_SERVICE_NAME = getI18N('please_enter_the_service_name') +I18N.ENTER_SERVICE_NAME = getI18N('please_enter_the_service_name'); /** * 查询 */ -I18N.QUERY = getI18N('query') +I18N.QUERY = getI18N('query'); /** * 查询 */ -I18N.PUBNODEDATA = getI18N('pubnodata', '') +I18N.PUBNODEDATA = getI18N('pubnodata', ''); /** * 服务名 */ -I18N.COLUMN_SERVICE_NAME = getI18N('table.column.service_name') +I18N.COLUMN_SERVICE_NAME = getI18N('table.column.service_name'); /** * 集群数目 */ -I18N.COLUMN_CLUSTER_COUNT = getI18N('table.column.cluster_count') +I18N.COLUMN_CLUSTER_COUNT = getI18N('table.column.cluster_count'); /** * IP数目 */ -I18N.COLUMN_IP_COUNT = getI18N('table.column.ip_count') +I18N.COLUMN_IP_COUNT = getI18N('table.column.ip_count'); /** * 健康程度 */ -I18N.COLUMN_HEALTH_STATUS = getI18N('table.column.health_status') +I18N.COLUMN_HEALTH_STATUS = getI18N('table.column.health_status'); /** * 操作 */ -I18N.COLUMN_OPERATION = getI18N('table.column.operation') +I18N.COLUMN_OPERATION = getI18N('table.column.operation'); /** * 详情 */ -I18N.DETAIL = getI18N('detail') +I18N.DETAIL = getI18N('detail'); /** * 删除 */ -I18N.DELETE = getI18N('delete') +I18N.DELETE = getI18N('delete'); /** * 提示 */ -I18N.PROMPT = getI18N('prompt') +I18N.PROMPT = getI18N('prompt'); /** * 提示 */ -I18N.PROMPT_DELETE = getI18N('prompt_delete') +I18N.PROMPT_DELETE = getI18N('prompt_delete'); /** * 删除 */ -I18N.DELETE = getI18N('delete') +I18N.DELETE = getI18N('delete'); /** * 创建服务 */ -I18N.CREATE = getI18N('create') +I18N.CREATE = getI18N('create'); export const STATUS_COLOR_MAPPING = { - 优: 'green', - 良: 'light-green', - 中: 'orange', - 差: 'red' -} + 优: 'green', + 良: 'light-green', + 中: 'orange', + 差: 'red', +}; diff --git a/console/src/main/resources/static/src/pages/ServiceManagement/ServiceList/index.js b/console/src/main/resources/static/src/pages/ServiceManagement/ServiceList/index.js index b48d559d4..ce5cda20b 100644 --- a/console/src/main/resources/static/src/pages/ServiceManagement/ServiceList/index.js +++ b/console/src/main/resources/static/src/pages/ServiceManagement/ServiceList/index.js @@ -11,6 +11,6 @@ * limitations under the License. */ -import ServiceList from './ServiceList' +import ServiceList from './ServiceList'; -export default ServiceList +export default ServiceList; diff --git a/console/src/main/resources/static/src/router.js b/console/src/main/resources/static/src/router.js index c3cea4025..b176f1a69 100644 --- a/console/src/main/resources/static/src/router.js +++ b/console/src/main/resources/static/src/router.js @@ -12,6 +12,7 @@ */ import React from 'react'; +import PropTypes from 'prop-types'; import { Router, Route, Switch } from 'dva/router'; import './lib.js'; import App from './containers/App'; @@ -29,26 +30,29 @@ import ServiceList from './pages/ServiceManagement/ServiceList'; import ServiceDetail from './pages/ServiceManagement/ServiceDetail'; function RouterConfig({ history }) { - return ( - - - - - - - - - - - - - - - - - - - ); + return ( + + + + + + + + + + + + + + + + + + + ); } +RouterConfig.propTypes = { + history: PropTypes.object, +}; export default RouterConfig; diff --git a/console/src/main/resources/static/src/routes/IndexPage.js b/console/src/main/resources/static/src/routes/IndexPage.js index 5f36b3a1f..e04ebc08d 100644 --- a/console/src/main/resources/static/src/routes/IndexPage.js +++ b/console/src/main/resources/static/src/routes/IndexPage.js @@ -18,7 +18,7 @@ import styles from './IndexPage.css'; function IndexPage() { return (
    -
    +

    Yay! Welcome to dva!

      diff --git a/console/src/main/resources/static/src/serviceMock.js b/console/src/main/resources/static/src/serviceMock.js index 38888b794..0519f11cf 100644 --- a/console/src/main/resources/static/src/serviceMock.js +++ b/console/src/main/resources/static/src/serviceMock.js @@ -12,202 +12,202 @@ */ module.exports = { - "method": [ - "get", - "post", - "put", - "delete", - "patch" - ], - "serviceList": [ - { - "registerName": "com.alibaba.nacos.service.dashlist", - "name": "", - "registerTo": null, - "url": "/diamond-ops/info", - "defaults": "{}", - "params": "{}", - "config": null, - "initialize": null, - "share": 0, - "exports": null, - "proxy": "", - "serviceDoc": null, - "ctime": "2018-05-19T07:24:01.000Z", - "mtime": "2018-08-28T10:19:46.000Z", - "author_id": 23, - "project_id": "nacos", - "is_mock": 0, - "method": 0, - "is_param": 0, - "is_proxy": 0, - "cookie": "{}", - "header": "{}", - "isJsonData": 0, - "paramsType": "[]", - "autoLoading": 0 - }, - { - "registerName": "com.alibaba.nacos.service.getLink", - "name": "getLink", - "registerTo": null, - "url": "/diamond-ops/viper/getLink", - "defaults": "{}", - "params": "{}", - "config": null, - "initialize": null, - "share": 0, - "exports": null, - "proxy": "", - "serviceDoc": null, - "ctime": "2017-12-03T07:38:56.000Z", - "mtime": "2018-08-28T10:19:46.000Z", - "author_id": 23, - "project_id": "nacos", - "is_mock": 0, - "method": 0, - "is_param": 0, - "is_proxy": 0, - "cookie": "{}", - "header": "{}", - "isJsonData": 0, - "paramsType": "[]", - "autoLoading": 0 - }, - { - "registerName": "com.alibaba.nacos.service.getLinks", - "name": "getLinks", - "registerTo": null, - "url": "/diamond-ops/viper/getLinks", - "defaults": "{}", - "params": "{}", - "config": null, - "initialize": null, - "share": 0, - "exports": null, - "proxy": "", - "serviceDoc": null, - "ctime": "2017-12-03T07:38:56.000Z", - "mtime": "2018-08-28T10:19:46.000Z", - "author_id": 23, - "project_id": "nacos", - "is_mock": 0, - "method": 0, - "is_param": 0, - "is_proxy": 0, - "cookie": "{}", - "header": "{}", - "isJsonData": 0, - "paramsType": "[]", - "autoLoading": 0 - }, - { - "registerName": "com.alibaba.nacos.service.deleteNameSpace", - "name": "删除命名空间", - "registerTo": null, - "url": "/diamond-ops/service/serverId/{serverId}/namespace/{namespace}", - "defaults": "{}", - "params": "{}", - "config": null, - "initialize": null, - "share": 0, - "exports": null, - "proxy": "", - "serviceDoc": null, - "ctime": "2017-12-03T07:38:56.000Z", - "mtime": "2018-08-28T10:19:46.000Z", - "author_id": 23, - "project_id": "nacos", - "is_mock": 0, - "method": 3, - "is_param": 0, - "is_proxy": 0, - "cookie": "{}", - "header": "{}", - "isJsonData": 0, - "paramsType": "[]", - "autoLoading": 0 - }, - { - "registerName": "com.alibaba.nacos.service.getMetaData", - "name": "获取metaData", - "registerTo": null, - "url": "/diamond-ops/meta/data", - "defaults": "{}", - "params": "{}", - "config": null, - "initialize": null, - "share": 0, - "exports": null, - "proxy": "", - "serviceDoc": null, - "ctime": "2017-12-03T07:38:56.000Z", - "mtime": "2018-08-28T10:19:46.000Z", - "author_id": 23, - "project_id": "nacos", - "is_mock": 0, - "method": 0, - "is_param": 0, - "is_proxy": 0, - "cookie": "{}", - "header": "{}", - "isJsonData": 0, - "paramsType": "[]", - "autoLoading": 0 - }, - { - "registerName": "com.alibaba.nacos.service.sendVerifyCode", - "name": "发送验证码", - "registerTo": null, - "url": "/diamond-ops/meta/sendVerifyCode", - "defaults": "{}", - "params": "{}", - "config": null, - "initialize": null, - "share": 0, - "exports": null, - "proxy": "", - "serviceDoc": null, - "ctime": "2017-12-03T07:38:56.000Z", - "mtime": "2018-08-28T10:19:46.000Z", - "author_id": 23, - "project_id": "nacos", - "is_mock": 0, - "method": 0, - "is_param": 0, - "is_proxy": 0, - "cookie": "{}", - "header": "{}", - "isJsonData": 0, - "paramsType": "[]", - "autoLoading": 0 - }, - { - "registerName": "com.alibaba.nacos.service.getDomain", - "name": "获取region", - "registerTo": null, - "url": "/diamond-ops/env/domain", - "defaults": "{}", - "params": "{}", - "config": null, - "initialize": null, - "share": 0, - "exports": null, - "proxy": "", - "serviceDoc": null, - "ctime": "2017-12-03T07:38:56.000Z", - "mtime": "2018-08-28T10:19:46.000Z", - "author_id": 23, - "project_id": "nacos", - "is_mock": 0, - "method": 0, - "is_param": 0, - "is_proxy": 0, - "cookie": "{}", - "header": "{}", - "isJsonData": 0, - "paramsType": "[]", - "autoLoading": 0 - } - ] -} \ No newline at end of file + method: [ + 'get', + 'post', + 'put', + 'delete', + 'patch', + ], + serviceList: [ + { + registerName: 'com.alibaba.nacos.service.dashlist', + name: '', + registerTo: null, + url: '/diamond-ops/info', + defaults: '{}', + params: '{}', + config: null, + initialize: null, + share: 0, + exports: null, + proxy: '', + serviceDoc: null, + ctime: '2018-05-19T07:24:01.000Z', + mtime: '2018-08-28T10:19:46.000Z', + author_id: 23, + project_id: 'nacos', + is_mock: 0, + method: 0, + is_param: 0, + is_proxy: 0, + cookie: '{}', + header: '{}', + isJsonData: 0, + paramsType: '[]', + autoLoading: 0, + }, + { + registerName: 'com.alibaba.nacos.service.getLink', + name: 'getLink', + registerTo: null, + url: '/diamond-ops/viper/getLink', + defaults: '{}', + params: '{}', + config: null, + initialize: null, + share: 0, + exports: null, + proxy: '', + serviceDoc: null, + ctime: '2017-12-03T07:38:56.000Z', + mtime: '2018-08-28T10:19:46.000Z', + author_id: 23, + project_id: 'nacos', + is_mock: 0, + method: 0, + is_param: 0, + is_proxy: 0, + cookie: '{}', + header: '{}', + isJsonData: 0, + paramsType: '[]', + autoLoading: 0, + }, + { + registerName: 'com.alibaba.nacos.service.getLinks', + name: 'getLinks', + registerTo: null, + url: '/diamond-ops/viper/getLinks', + defaults: '{}', + params: '{}', + config: null, + initialize: null, + share: 0, + exports: null, + proxy: '', + serviceDoc: null, + ctime: '2017-12-03T07:38:56.000Z', + mtime: '2018-08-28T10:19:46.000Z', + author_id: 23, + project_id: 'nacos', + is_mock: 0, + method: 0, + is_param: 0, + is_proxy: 0, + cookie: '{}', + header: '{}', + isJsonData: 0, + paramsType: '[]', + autoLoading: 0, + }, + { + registerName: 'com.alibaba.nacos.service.deleteNameSpace', + name: '删除命名空间', + registerTo: null, + url: '/diamond-ops/service/serverId/{serverId}/namespace/{namespace}', + defaults: '{}', + params: '{}', + config: null, + initialize: null, + share: 0, + exports: null, + proxy: '', + serviceDoc: null, + ctime: '2017-12-03T07:38:56.000Z', + mtime: '2018-08-28T10:19:46.000Z', + author_id: 23, + project_id: 'nacos', + is_mock: 0, + method: 3, + is_param: 0, + is_proxy: 0, + cookie: '{}', + header: '{}', + isJsonData: 0, + paramsType: '[]', + autoLoading: 0, + }, + { + registerName: 'com.alibaba.nacos.service.getMetaData', + name: '获取metaData', + registerTo: null, + url: '/diamond-ops/meta/data', + defaults: '{}', + params: '{}', + config: null, + initialize: null, + share: 0, + exports: null, + proxy: '', + serviceDoc: null, + ctime: '2017-12-03T07:38:56.000Z', + mtime: '2018-08-28T10:19:46.000Z', + author_id: 23, + project_id: 'nacos', + is_mock: 0, + method: 0, + is_param: 0, + is_proxy: 0, + cookie: '{}', + header: '{}', + isJsonData: 0, + paramsType: '[]', + autoLoading: 0, + }, + { + registerName: 'com.alibaba.nacos.service.sendVerifyCode', + name: '发送验证码', + registerTo: null, + url: '/diamond-ops/meta/sendVerifyCode', + defaults: '{}', + params: '{}', + config: null, + initialize: null, + share: 0, + exports: null, + proxy: '', + serviceDoc: null, + ctime: '2017-12-03T07:38:56.000Z', + mtime: '2018-08-28T10:19:46.000Z', + author_id: 23, + project_id: 'nacos', + is_mock: 0, + method: 0, + is_param: 0, + is_proxy: 0, + cookie: '{}', + header: '{}', + isJsonData: 0, + paramsType: '[]', + autoLoading: 0, + }, + { + registerName: 'com.alibaba.nacos.service.getDomain', + name: '获取region', + registerTo: null, + url: '/diamond-ops/env/domain', + defaults: '{}', + params: '{}', + config: null, + initialize: null, + share: 0, + exports: null, + proxy: '', + serviceDoc: null, + ctime: '2017-12-03T07:38:56.000Z', + mtime: '2018-08-28T10:19:46.000Z', + author_id: 23, + project_id: 'nacos', + is_mock: 0, + method: 0, + is_param: 0, + is_proxy: 0, + cookie: '{}', + header: '{}', + isJsonData: 0, + paramsType: '[]', + autoLoading: 0, + }, + ], +}; diff --git a/console/src/main/resources/static/src/utils/ajaxrequest.js b/console/src/main/resources/static/src/utils/ajaxrequest.js index 488fd235e..ee025115b 100644 --- a/console/src/main/resources/static/src/utils/ajaxrequest.js +++ b/console/src/main/resources/static/src/utils/ajaxrequest.js @@ -14,13 +14,12 @@ import $ from 'jquery'; export default function ajaxrequest(options) { - let promise = $.ajax({ - url: options.url, - timeout : options.timeout, //超时时间设置,单位毫秒设置为1小时 - dataType: options.dataType,//返回的数据格式 - type : options.type - }); - return promise.done(data => ({ data })); + const promise = $.ajax({ + url: options.url, + timeout: options.timeout, // 超时时间设置,单位毫秒设置为1小时 + dataType: options.dataType, // 返回的数据格式 + type: options.type, + }); + return promise.done(data => ({ data })); } - diff --git a/console/src/main/resources/static/src/utils/localstorage.js b/console/src/main/resources/static/src/utils/localstorage.js index 22b51a358..0b69b4438 100644 --- a/console/src/main/resources/static/src/utils/localstorage.js +++ b/console/src/main/resources/static/src/utils/localstorage.js @@ -12,14 +12,14 @@ */ module.exports = { - set: function(key,value){ - window.localStorage.setItem(key,value); - }, - get: function(key) { - return window.localStorage.getItem(key); - }, - remove: function(key) { - window.localStorage.removeItem(key); - } + set(key, value) { + window.localStorage.setItem(key, value); + }, + get(key) { + return window.localStorage.getItem(key); + }, + remove(key) { + window.localStorage.removeItem(key); + }, -} \ No newline at end of file +}; diff --git a/console/src/main/resources/static/src/utils/nacosutil.js b/console/src/main/resources/static/src/utils/nacosutil.js index 0c97e07ed..d36fe060a 100644 --- a/console/src/main/resources/static/src/utils/nacosutil.js +++ b/console/src/main/resources/static/src/utils/nacosutil.js @@ -14,7 +14,7 @@ /* eslint-disable import/prefer-default-export */ export const throttle = (fn, delay) => { let timer = null; - return function (...args) { + return function(...args) { const context = this; clearTimeout(timer); timer = setTimeout(() => { @@ -26,14 +26,14 @@ export const throttle = (fn, delay) => { export const getScrollTop = () => { let scrollTop = 0; if (document.documentElement && document.documentElement.scrollTop) { - scrollTop = document.documentElement.scrollTop; + ({ scrollTop } = document.documentElement); } else if (document.body) { - scrollTop = document.body.scrollTop; + ({ scrollTop } = document.body); } return scrollTop; }; -export const getLink = (link) => { +export const getLink = link => { if (`${link}`.length > 1 && /^\/[^/]/.test(`${link}`)) { return `${window.rootPath}${link}`; }