From 425f4c019aa53c9e519b98e6b31799f30b2bc3d6 Mon Sep 17 00:00:00 2001 From: Eric Hettiaratchi <35978114+Braavos96@users.noreply.github.com> Date: Tue, 23 Jul 2019 11:51:13 +0100 Subject: [PATCH 01/22] Add unit tests for common.GroupKey and utils.MD5 Fully-qualified classname com.alibaba.nacos.client.config.common.GroupKey com.alibaba.nacos.client.config.utils.MD5 These tests were written using Diffblue Cover. --- .../client/config/common/GroupKeyTest.java | 67 +++++++++++++++++ .../nacos/client/config/utils/MD5Test.java | 71 +++++++++++++++++++ 2 files changed, 138 insertions(+) create mode 100644 client/src/test/java/com/alibaba/nacos/client/config/common/GroupKeyTest.java create mode 100644 client/src/test/java/com/alibaba/nacos/client/config/utils/MD5Test.java diff --git a/client/src/test/java/com/alibaba/nacos/client/config/common/GroupKeyTest.java b/client/src/test/java/com/alibaba/nacos/client/config/common/GroupKeyTest.java new file mode 100644 index 000000000..98d3009cf --- /dev/null +++ b/client/src/test/java/com/alibaba/nacos/client/config/common/GroupKeyTest.java @@ -0,0 +1,67 @@ +/* + * Copyright 1999-2019 Alibaba Group Holding Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.alibaba.nacos.client.config.common; + +import org.junit.Assert; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; + +public class GroupKeyTest { + + @Rule + public final ExpectedException thrown = ExpectedException.none(); + + @Test + public void testGetKey() { + Assert.assertEquals("1+foo", GroupKey.getKey("1", "foo")); + Assert.assertEquals("1+foo+bar", GroupKey.getKey("1", "foo", "bar")); + Assert.assertEquals("1+f%2Boo+b%25ar", + GroupKey.getKey("1", "f+oo", "b%ar")); + } + + @Test + public void testGetKeyTenant() { + Assert.assertEquals("1+foo+bar", + GroupKey.getKeyTenant("1", "foo", "bar")); + } + + @Test + public void testParseKey() { + Assert.assertArrayEquals(new String[]{null, "f+oo", null}, + GroupKey.parseKey("f%2Boo")); + Assert.assertArrayEquals(new String[]{null, "f%oo", null}, + GroupKey.parseKey("f%25oo")); + } + + @Test + public void testParseKeyIllegalArgumentException1() { + thrown.expect(IllegalArgumentException.class); + GroupKey.parseKey(""); + } + + @Test + public void testParseKeyIllegalArgumentException2() { + thrown.expect(IllegalArgumentException.class); + GroupKey.parseKey("f%oo"); + } + + @Test + public void testParseKeyIllegalArgumentException3() { + thrown.expect(IllegalArgumentException.class); + GroupKey.parseKey("f+o+o+bar"); + } +} diff --git a/client/src/test/java/com/alibaba/nacos/client/config/utils/MD5Test.java b/client/src/test/java/com/alibaba/nacos/client/config/utils/MD5Test.java new file mode 100644 index 000000000..21ca3b98e --- /dev/null +++ b/client/src/test/java/com/alibaba/nacos/client/config/utils/MD5Test.java @@ -0,0 +1,71 @@ +/* + * Copyright 1999-2019 Alibaba Group Holding Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.alibaba.nacos.client.config.utils; + +import org.junit.Assert; +import org.junit.Test; + +public class MD5Test { + + @Test + public void testGetMD5String() { + Assert.assertEquals("d41d8cd98f00b204e9800998ecf8427e", + MD5.getInstance().getMD5String("")); + Assert.assertEquals("acbd18db4cc2f85cedef654fccc4a4d8", + MD5.getInstance().getMD5String("foo")); + + Assert.assertEquals("d41d8cd98f00b204e9800998ecf8427e", + MD5.getInstance().getMD5String(new byte[0])); + Assert.assertEquals("5289df737df57326fcdd22597afb1fac", + MD5.getInstance().getMD5String(new byte[]{1, 2, 3})); + } + + @Test + public void testGetMD5Bytes() { + byte[] bytes1 = new byte[]{-44, 29, -116, -39, -113, 0, -78, + 4, -23, -128, 9, -104, -20, -8, 66, 126}; + byte[] bytes2 = new byte[]{82, -119, -33, 115, 125, -11, 115, + 38, -4, -35, 34, 89, 122, -5, 31, -84}; + + Assert.assertArrayEquals(bytes1, + MD5.getInstance().getMD5Bytes(new byte[0])); + Assert.assertArrayEquals(bytes2, + MD5.getInstance().getMD5Bytes(new byte[]{1, 2, 3})); + } + + @Test + public void testHash() { + byte[] bytes1 = new byte[]{-44, 29, -116, -39, -113, 0, -78, + 4, -23, -128, 9, -104, -20, -8, 66, 126}; + byte[] bytes2 = new byte[]{-84, -67, 24, -37, 76, -62, -8, 92, + -19, -17, 101, 79, -52, -60, -92, -40}; + byte[] bytes3 = new byte[]{82, -119, -33, 115, 125, -11, 115, + 38, -4, -35, 34, 89, 122, -5, 31, -84}; + + Assert.assertArrayEquals(bytes1, MD5.getInstance().hash("")); + Assert.assertArrayEquals(bytes2, MD5.getInstance().hash("foo")); + Assert.assertArrayEquals(bytes1, MD5.getInstance().hash(new byte[0])); + Assert.assertArrayEquals(bytes3, + MD5.getInstance().hash(new byte[]{1, 2, 3})); + } + + @Test + public void testBytes2string() { + Assert.assertEquals("", MD5.getInstance().bytes2string(new byte[0])); + Assert.assertEquals("010203", + MD5.getInstance().bytes2string(new byte[]{1, 2, 3})); + } +} From 74694ede6e1a66ca41b53212da99e696e5ebc78f Mon Sep 17 00:00:00 2001 From: keran <213539@qq.com> Date: Tue, 30 Jul 2019 13:56:12 +0800 Subject: [PATCH 02/22] =?UTF-8?q?=E4=BF=AE=E5=A4=8D#1583?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/console-fe/src/locales/en-US.js | 2 + .../static/console-fe/src/locales/zh-CN.js | 2 + .../ConfigurationManagement.js | 41 +++++++++---------- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/console/src/main/resources/static/console-fe/src/locales/en-US.js b/console/src/main/resources/static/console-fe/src/locales/en-US.js index acc8e2982..a4094c9ed 100644 --- a/console/src/main/resources/static/console-fe/src/locales/en-US.js +++ b/console/src/main/resources/static/console-fe/src/locales/en-US.js @@ -291,6 +291,8 @@ const I18N_CONF = { target: 'Target:', selectNamespace: 'Select Namespace', selectedEntry: '| Selected Entry', + cloneSelectedAlertTitle: 'Clone config', + cloneSelectedAlertContent: 'please select the configuration to clone', }, NewConfig: { newListingMain: 'Create Configuration', diff --git a/console/src/main/resources/static/console-fe/src/locales/zh-CN.js b/console/src/main/resources/static/console-fe/src/locales/zh-CN.js index df9bf0e09..f82313fab 100644 --- a/console/src/main/resources/static/console-fe/src/locales/zh-CN.js +++ b/console/src/main/resources/static/console-fe/src/locales/zh-CN.js @@ -289,6 +289,8 @@ const I18N_CONF = { target: '目标空间:', selectNamespace: '请选择命名空间', selectedEntry: '| 选中的条目', + cloneSelectedAlertTitle: '配置克隆', + cloneSelectedAlertContent: '请选择要克隆的配置', }, NewConfig: { newListingMain: '新建配置', diff --git a/console/src/main/resources/static/console-fe/src/pages/ConfigurationManagement/ConfigurationManagement/ConfigurationManagement.js b/console/src/main/resources/static/console-fe/src/pages/ConfigurationManagement/ConfigurationManagement/ConfigurationManagement.js index fb3f245cc..8eefaf87b 100644 --- a/console/src/main/resources/static/console-fe/src/pages/ConfigurationManagement/ConfigurationManagement/ConfigurationManagement.js +++ b/console/src/main/resources/static/console-fe/src/pages/ConfigurationManagement/ConfigurationManagement/ConfigurationManagement.js @@ -100,6 +100,10 @@ class ConfigurationManagement extends React.Component { contentList: [], isAdvancedQuery: false, isCheckAll: false, + rowSelection: { + onChange: this.configDataTableOnChange.bind(this), + selectedRowKeys: [], + }, }; const obj = { dataId: this.dataId || '', @@ -250,6 +254,10 @@ class ConfigurationManagement extends React.Component { }); } this.getData(); + configsTableSelected.clear(); + const { rowSelection } = this.state; + rowSelection.selectedRowKeys = []; + this.setState({ rowSelection }); } getData(pageNo = 1, clearSelect = true) { @@ -704,8 +712,8 @@ class ConfigurationManagement extends React.Component { self.field.setValue('cloneTargetSpace', undefined); if (configsTableSelected.size === 0) { Dialog.alert({ - title: locale.exportSelectedAlertTitle, - content: locale.exportSelectedAlertContent, + title: locale.cloneSelectedAlertTitle, + content: locale.cloneSelectedAlertContent, }); return; } @@ -1024,22 +1032,14 @@ class ConfigurationManagement extends React.Component { }); } - configsTableOnSelect(selected, record, records) { - if (selected) { - configsTableSelected.set(record.id, record); - } else { - configsTableSelected.delete(record.id); - } - } - - configsTableOnSelectAll(selected, records) { - if (selected) { - records.forEach((record, i) => { - configsTableSelected.set(record.id, record); - }); - } else { - configsTableSelected.clear(); - } + configDataTableOnChange(ids, records) { + const { rowSelection } = this.state; + rowSelection.selectedRowKeys = ids; + this.setState({ rowSelection }); + configsTableSelected.clear(); + ids.forEach((id, i) => { + configsTableSelected.set(id, id); + }); } render() { @@ -1239,10 +1239,7 @@ class ConfigurationManagement extends React.Component { fixedHeader maxBodyHeight={400} ref={'dataTable'} - rowSelection={{ - onSelect: this.configsTableOnSelect, - onSelectAll: this.configsTableOnSelectAll, - }} + rowSelection={this.state.rowSelection} > From 934c4238c13ef413e815214a1a91c3d267d4e504 Mon Sep 17 00:00:00 2001 From: Thomas Perkins Date: Tue, 6 Aug 2019 17:15:01 +0100 Subject: [PATCH 03/22] Add unit tests for com.alibaba.nacos.config.server.utils.GroupKey These tests were written using Diffblue Cover --- .../config/server/utils/GroupKeyTest.java | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) diff --git a/config/src/test/java/com/alibaba/nacos/config/server/utils/GroupKeyTest.java b/config/src/test/java/com/alibaba/nacos/config/server/utils/GroupKeyTest.java index 56077cc2e..2b8e3b65d 100644 --- a/config/src/test/java/com/alibaba/nacos/config/server/utils/GroupKeyTest.java +++ b/config/src/test/java/com/alibaba/nacos/config/server/utils/GroupKeyTest.java @@ -16,7 +16,9 @@ package com.alibaba.nacos.config.server.utils; import org.junit.Assert; +import org.junit.Rule; import org.junit.Test; +import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; @@ -25,6 +27,8 @@ import org.springframework.test.context.web.WebAppConfiguration; @WebAppConfiguration public class GroupKeyTest { + @Rule public final ExpectedException thrown = ExpectedException.none(); + @Test public void test_parseGroupKey_非法的() { String key = "11111+222+333333+444"; @@ -64,4 +68,122 @@ public class GroupKeyTest { Assert.assertEquals("11111%", pair[0]); Assert.assertEquals("222", pair[1]); } + + @Test + public void getKey_ThreeParams() { + + // Act + final String actual = GroupKey.getKey(",", ",", "3"); + + // Assert result + Assert.assertEquals(",+,+3", actual); + } + + @Test + public void getKey_TwoParams() { + + // Act + final String actual = GroupKey.getKey("3", "\'"); + + // Assert result + Assert.assertEquals("3+\'", actual); + } + + @Test + public void getKeyTenant_Plus_ThreeParams() { + + // Act + final String actual = GroupKey.getKeyTenant("3", "1", ","); + + // Assert result + Assert.assertEquals("3+1+,", actual); + } + + @Test + public void getKeyTenant_Percent_ThreeParams() { + + // Act + final String actual = GroupKey.getKeyTenant("\u0000\u0000", "%+", null); + + // Assert result + Assert.assertEquals("\u0000\u0000+%25%2B", actual); + } + + @Test + public void parseKey_SingleCharacter() { + + // Act + final String[] actual = GroupKey.parseKey("/"); + + // Assert result + Assert.assertArrayEquals(new String[] {null, "/", null}, actual); + } + + @Test + public void parseKey_Plus_IllegalArgumentException() { + + // Act + thrown.expect(IllegalArgumentException.class); + GroupKey.parseKey("+"); + + // Method is not expected to return due to exception thrown + } + + @Test + public void parseKey_Percent_IllegalArgumentException() { + + // Act + thrown.expect(IllegalArgumentException.class); + GroupKey.parseKey("%%%5\u0000??????????????"); + + // Method is not expected to return due to exception thrown + } + + @Test + public void parseKey_Invalid_StringIndexOutOfBoundsException() { + + // Act + thrown.expect(StringIndexOutOfBoundsException.class); + GroupKey.parseKey("++%"); + + // Method is not expected to return due to exception thrown + } + + @Test + public void urlEncode_Plus() { + + // Arrange + final StringBuilder sb = new StringBuilder("????"); + + // Act + GroupKey.urlEncode("+", sb); + + // Assert side effects + Assert.assertNotNull(sb); + Assert.assertEquals("????%2B", sb.toString()); + } + + @Test + public void urlEncode_Percent() { + + // Arrange + final StringBuilder sb = new StringBuilder("??????"); + + // Act + GroupKey.urlEncode("%", sb); + + // Assert side effects + Assert.assertNotNull(sb); + Assert.assertEquals("??????%25", sb.toString()); + } + + @Test + public void urlEncode_NullStringBuilder() { + + // Act + thrown.expect(NullPointerException.class); + GroupKey.urlEncode("+", null); + + // Method is not expected to return due to exception thrown + } } From 7f0bcaa5cb4992a6c60809a67de3354e615bfeb8 Mon Sep 17 00:00:00 2001 From: universefeeler Date: Mon, 9 Sep 2019 10:48:11 +0800 Subject: [PATCH 04/22] feature(triggerFlag): add triggerFlag for service --- .../com/alibaba/nacos/api/naming/pojo/Service.java | 14 ++++++++++++++ .../naming/controllers/CatalogController.java | 14 ++------------ .../com/alibaba/nacos/naming/core/Service.java | 9 +++++++-- .../com/alibaba/nacos/naming/pojo/ServiceView.java | 9 +++++++++ 4 files changed, 32 insertions(+), 14 deletions(-) diff --git a/api/src/main/java/com/alibaba/nacos/api/naming/pojo/Service.java b/api/src/main/java/com/alibaba/nacos/api/naming/pojo/Service.java index 7e8fe2d34..cb7a9afb5 100644 --- a/api/src/main/java/com/alibaba/nacos/api/naming/pojo/Service.java +++ b/api/src/main/java/com/alibaba/nacos/api/naming/pojo/Service.java @@ -34,6 +34,11 @@ public class Service { */ private String name; + /** + * service protect threshold trigger flag + */ + private boolean triggerFlag = false; + /** * protect threshold */ @@ -102,10 +107,19 @@ public class Service { this.metadata.put(key, value); } + public boolean isTriggerFlag() { + return triggerFlag; + } + + public void setTriggerFlag(boolean triggerFlag) { + this.triggerFlag = triggerFlag; + } + @Override public String toString() { return "Service{" + "name='" + name + '\'' + + "triggerFlag='" + triggerFlag + '\'' + ", protectThreshold=" + protectThreshold + ", appName='" + appName + '\'' + ", groupName='" + groupName + '\'' + diff --git a/naming/src/main/java/com/alibaba/nacos/naming/controllers/CatalogController.java b/naming/src/main/java/com/alibaba/nacos/naming/controllers/CatalogController.java index 6d47e67e5..6b24b2a15 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/controllers/CatalogController.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/controllers/CatalogController.java @@ -284,18 +284,8 @@ public class CatalogController { serviceView.setGroupName(NamingUtils.getGroupName(service.getName())); serviceView.setClusterCount(service.getClusterMap().size()); serviceView.setIpCount(service.allIPs().size()); - - // FIXME should be optimized: - int validCount = 0; - for (Instance instance : service.allIPs()) { - if (instance.isHealthy()) { - validCount++; - } - - } - - serviceView.setHealthyInstanceCount(validCount); - + serviceView.setHealthyInstanceCount(service.healthyInstanceCount()); + serviceView.setTriggerFlag(service.isTriggerFlag()); serviceJsonArray.add(serviceView); } diff --git a/naming/src/main/java/com/alibaba/nacos/naming/core/Service.java b/naming/src/main/java/com/alibaba/nacos/naming/core/Service.java index cedbaa555..76eea304d 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/core/Service.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/core/Service.java @@ -172,6 +172,8 @@ public class Service extends com.alibaba.nacos.api.naming.pojo.Service implement updateIPs(value.getInstanceList(), KeyBuilder.matchEphemeralInstanceListKey(key)); + updateTriggerFlag(); + recalculateChecksum(); } @@ -191,8 +193,9 @@ public class Service extends com.alibaba.nacos.api.naming.pojo.Service implement return healthyCount; } - public boolean meetProtectThreshold() { - return (healthyInstanceCount() * 1.0 / allIPs().size()) <= getProtectThreshold(); + public void updateTriggerFlag() { + boolean triggerFlag = (healthyInstanceCount() * 1.0 / allIPs().size()) <= getProtectThreshold(); + setTriggerFlag(triggerFlag); } public void updateIPs(Collection instances, boolean ephemeral) { @@ -422,6 +425,8 @@ public class Service extends com.alibaba.nacos.api.naming.pojo.Service implement setMetadata(vDom.getMetadata()); + updateTriggerFlag(); + updateOrAddCluster(vDom.getClusterMap().values()); remvDeadClusters(this, vDom); recalculateChecksum(); diff --git a/naming/src/main/java/com/alibaba/nacos/naming/pojo/ServiceView.java b/naming/src/main/java/com/alibaba/nacos/naming/pojo/ServiceView.java index 056397dc9..e35e0250b 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/pojo/ServiceView.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/pojo/ServiceView.java @@ -27,6 +27,7 @@ public class ServiceView { private int clusterCount; private int ipCount; private int healthyInstanceCount; + private boolean triggerFlag; public String getName() { return name; @@ -68,6 +69,14 @@ public class ServiceView { this.healthyInstanceCount = healthyInstanceCount; } + public boolean isTriggerFlag() { + return triggerFlag; + } + + public void setTriggerFlag(boolean triggerFlag) { + this.triggerFlag = triggerFlag; + } + @Override public String toString() { return JSON.toJSONString(this); From 5681ca3f78862903c1915b190d90c777d8527ebf Mon Sep 17 00:00:00 2001 From: universefeeler Date: Mon, 9 Sep 2019 15:13:24 +0800 Subject: [PATCH 05/22] feture(triggerFlag): add frontend show triggerFlag --- .../src/main/resources/static/console-fe/src/locales/en-US.js | 1 + .../src/main/resources/static/console-fe/src/locales/zh-CN.js | 1 + .../src/pages/ServiceManagement/ServiceList/ServiceList.js | 1 + 3 files changed, 3 insertions(+) diff --git a/console/src/main/resources/static/console-fe/src/locales/en-US.js b/console/src/main/resources/static/console-fe/src/locales/en-US.js index f1315f082..7ab529a80 100644 --- a/console/src/main/resources/static/console-fe/src/locales/en-US.js +++ b/console/src/main/resources/static/console-fe/src/locales/en-US.js @@ -101,6 +101,7 @@ const I18N_CONF = { columnClusterCount: 'Cluster Count', columnIpCount: 'Instance Count', columnHealthyInstanceCount: 'Healthy Instance Count', + columnTriggerFlag: 'Trigger Flag', operation: 'Operation', detail: 'Details', sampleCode: 'Code Example', diff --git a/console/src/main/resources/static/console-fe/src/locales/zh-CN.js b/console/src/main/resources/static/console-fe/src/locales/zh-CN.js index 9218da10a..c2fd5cec3 100644 --- a/console/src/main/resources/static/console-fe/src/locales/zh-CN.js +++ b/console/src/main/resources/static/console-fe/src/locales/zh-CN.js @@ -101,6 +101,7 @@ const I18N_CONF = { columnClusterCount: '集群数目', columnIpCount: '实例数', columnHealthyInstanceCount: '健康实例数', + columnTriggerFlag: '触发阈值', operation: '操作', detail: '详情', sampleCode: '示例代码', diff --git a/console/src/main/resources/static/console-fe/src/pages/ServiceManagement/ServiceList/ServiceList.js b/console/src/main/resources/static/console-fe/src/pages/ServiceManagement/ServiceList/ServiceList.js index 642130fda..73a943446 100644 --- a/console/src/main/resources/static/console-fe/src/pages/ServiceManagement/ServiceList/ServiceList.js +++ b/console/src/main/resources/static/console-fe/src/pages/ServiceManagement/ServiceList/ServiceList.js @@ -281,6 +281,7 @@ class ServiceList extends React.Component { title={locale.columnHealthyInstanceCount} dataIndex="healthyInstanceCount" /> + Date: Mon, 9 Sep 2019 20:24:59 +0800 Subject: [PATCH 06/22] improve(triggerFlag): add pre check for triggerFlag --- .../nacos/naming/controllers/CatalogController.java | 2 +- .../main/java/com/alibaba/nacos/naming/core/Service.java | 9 +++++++++ .../java/com/alibaba/nacos/naming/pojo/ServiceView.java | 6 +++--- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/naming/src/main/java/com/alibaba/nacos/naming/controllers/CatalogController.java b/naming/src/main/java/com/alibaba/nacos/naming/controllers/CatalogController.java index 6b24b2a15..d051939ca 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/controllers/CatalogController.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/controllers/CatalogController.java @@ -285,7 +285,7 @@ public class CatalogController { serviceView.setClusterCount(service.getClusterMap().size()); serviceView.setIpCount(service.allIPs().size()); serviceView.setHealthyInstanceCount(service.healthyInstanceCount()); - serviceView.setTriggerFlag(service.isTriggerFlag()); + serviceView.setTriggerFlag(service.isTriggerFlag()?"True":"False"); serviceJsonArray.add(serviceView); } diff --git a/naming/src/main/java/com/alibaba/nacos/naming/core/Service.java b/naming/src/main/java/com/alibaba/nacos/naming/core/Service.java index 76eea304d..f19772533 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/core/Service.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/core/Service.java @@ -194,6 +194,15 @@ public class Service extends com.alibaba.nacos.api.naming.pojo.Service implement } public void updateTriggerFlag() { + if(0 == healthyInstanceCount()) { + setTriggerFlag(true); + return; + } + Float compareValue = 0.0F; + if(Float.floatToIntBits(compareValue) == getProtectThreshold()) { + setTriggerFlag(false); + return; + } boolean triggerFlag = (healthyInstanceCount() * 1.0 / allIPs().size()) <= getProtectThreshold(); setTriggerFlag(triggerFlag); } diff --git a/naming/src/main/java/com/alibaba/nacos/naming/pojo/ServiceView.java b/naming/src/main/java/com/alibaba/nacos/naming/pojo/ServiceView.java index e35e0250b..014725bff 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/pojo/ServiceView.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/pojo/ServiceView.java @@ -27,7 +27,7 @@ public class ServiceView { private int clusterCount; private int ipCount; private int healthyInstanceCount; - private boolean triggerFlag; + private String triggerFlag; public String getName() { return name; @@ -69,11 +69,11 @@ public class ServiceView { this.healthyInstanceCount = healthyInstanceCount; } - public boolean isTriggerFlag() { + public String isTriggerFlag() { return triggerFlag; } - public void setTriggerFlag(boolean triggerFlag) { + public void setTriggerFlag(String triggerFlag) { this.triggerFlag = triggerFlag; } From f95215f218576f219194e6f6ba3107eb36b8c3c6 Mon Sep 17 00:00:00 2001 From: universefeeler Date: Mon, 9 Sep 2019 21:25:38 +0800 Subject: [PATCH 07/22] chore(triggerFlag): adjust some details --- .../main/java/com/alibaba/nacos/naming/pojo/ServiceView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/naming/src/main/java/com/alibaba/nacos/naming/pojo/ServiceView.java b/naming/src/main/java/com/alibaba/nacos/naming/pojo/ServiceView.java index 014725bff..afe2e21ea 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/pojo/ServiceView.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/pojo/ServiceView.java @@ -69,7 +69,7 @@ public class ServiceView { this.healthyInstanceCount = healthyInstanceCount; } - public String isTriggerFlag() { + public String getTriggerFlag() { return triggerFlag; } From 54ae846cb71c13799f29985119542b9721844143 Mon Sep 17 00:00:00 2001 From: universefeeler Date: Tue, 10 Sep 2019 15:53:26 +0800 Subject: [PATCH 08/22] improve(instanceHealth): add update logic --- .../alibaba/nacos/naming/healthcheck/ClientBeatProcessor.java | 1 + 1 file changed, 1 insertion(+) diff --git a/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/ClientBeatProcessor.java b/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/ClientBeatProcessor.java index 00b6bacb3..4dc4a5672 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/ClientBeatProcessor.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/ClientBeatProcessor.java @@ -88,5 +88,6 @@ public class ClientBeatProcessor implements Runnable { } } } + service.updateTriggerFlag(); } } From 0f3c9f3c87d43fbb9048e3e59b66c6fefaf28fa7 Mon Sep 17 00:00:00 2001 From: universefeeler Date: Tue, 17 Sep 2019 19:52:12 +0800 Subject: [PATCH 09/22] improve(triggerFlag): adjust triggerFlag calculation chance --- .../com/alibaba/nacos/api/naming/pojo/Service.java | 14 -------------- .../naming/controllers/CatalogController.java | 2 +- .../com/alibaba/nacos/naming/core/Service.java | 12 ++++-------- .../naming/healthcheck/ClientBeatProcessor.java | 1 - 4 files changed, 5 insertions(+), 24 deletions(-) diff --git a/api/src/main/java/com/alibaba/nacos/api/naming/pojo/Service.java b/api/src/main/java/com/alibaba/nacos/api/naming/pojo/Service.java index cb7a9afb5..7e8fe2d34 100644 --- a/api/src/main/java/com/alibaba/nacos/api/naming/pojo/Service.java +++ b/api/src/main/java/com/alibaba/nacos/api/naming/pojo/Service.java @@ -34,11 +34,6 @@ public class Service { */ private String name; - /** - * service protect threshold trigger flag - */ - private boolean triggerFlag = false; - /** * protect threshold */ @@ -107,19 +102,10 @@ public class Service { this.metadata.put(key, value); } - public boolean isTriggerFlag() { - return triggerFlag; - } - - public void setTriggerFlag(boolean triggerFlag) { - this.triggerFlag = triggerFlag; - } - @Override public String toString() { return "Service{" + "name='" + name + '\'' + - "triggerFlag='" + triggerFlag + '\'' + ", protectThreshold=" + protectThreshold + ", appName='" + appName + '\'' + ", groupName='" + groupName + '\'' + diff --git a/naming/src/main/java/com/alibaba/nacos/naming/controllers/CatalogController.java b/naming/src/main/java/com/alibaba/nacos/naming/controllers/CatalogController.java index d051939ca..2b552b2eb 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/controllers/CatalogController.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/controllers/CatalogController.java @@ -285,7 +285,7 @@ public class CatalogController { serviceView.setClusterCount(service.getClusterMap().size()); serviceView.setIpCount(service.allIPs().size()); serviceView.setHealthyInstanceCount(service.healthyInstanceCount()); - serviceView.setTriggerFlag(service.isTriggerFlag()?"True":"False"); + serviceView.setTriggerFlag(service.triggerFlag()?"true":"false"); serviceJsonArray.add(serviceView); } diff --git a/naming/src/main/java/com/alibaba/nacos/naming/core/Service.java b/naming/src/main/java/com/alibaba/nacos/naming/core/Service.java index f19772533..2423bf7c9 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/core/Service.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/core/Service.java @@ -172,8 +172,6 @@ public class Service extends com.alibaba.nacos.api.naming.pojo.Service implement updateIPs(value.getInstanceList(), KeyBuilder.matchEphemeralInstanceListKey(key)); - updateTriggerFlag(); - recalculateChecksum(); } @@ -193,18 +191,16 @@ public class Service extends com.alibaba.nacos.api.naming.pojo.Service implement return healthyCount; } - public void updateTriggerFlag() { + public boolean triggerFlag() { if(0 == healthyInstanceCount()) { - setTriggerFlag(true); - return; + return true; } Float compareValue = 0.0F; if(Float.floatToIntBits(compareValue) == getProtectThreshold()) { - setTriggerFlag(false); - return; + return false; } boolean triggerFlag = (healthyInstanceCount() * 1.0 / allIPs().size()) <= getProtectThreshold(); - setTriggerFlag(triggerFlag); + return triggerFlag; } public void updateIPs(Collection instances, boolean ephemeral) { diff --git a/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/ClientBeatProcessor.java b/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/ClientBeatProcessor.java index 4dc4a5672..00b6bacb3 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/ClientBeatProcessor.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/healthcheck/ClientBeatProcessor.java @@ -88,6 +88,5 @@ public class ClientBeatProcessor implements Runnable { } } } - service.updateTriggerFlag(); } } From c0a6adc0833f8f5086b3b2013db5097d726ff640 Mon Sep 17 00:00:00 2001 From: universefeeler Date: Wed, 18 Sep 2019 12:04:48 +0800 Subject: [PATCH 10/22] chore(reiggerFlag): delete unused function --- naming/src/main/java/com/alibaba/nacos/naming/core/Service.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/naming/src/main/java/com/alibaba/nacos/naming/core/Service.java b/naming/src/main/java/com/alibaba/nacos/naming/core/Service.java index 2423bf7c9..b4956b32e 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/core/Service.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/core/Service.java @@ -430,8 +430,6 @@ public class Service extends com.alibaba.nacos.api.naming.pojo.Service implement setMetadata(vDom.getMetadata()); - updateTriggerFlag(); - updateOrAddCluster(vDom.getClusterMap().values()); remvDeadClusters(this, vDom); recalculateChecksum(); From 5413402869f748619feffd90f88fa09eef631d00 Mon Sep 17 00:00:00 2001 From: universefeeler Date: Thu, 19 Sep 2019 20:03:09 +0800 Subject: [PATCH 11/22] improve(triggerFlag): improve instance health flag --- .../resources/static/console-fe/src/locales/en-US.js | 2 +- .../resources/static/console-fe/src/locales/zh-CN.js | 2 +- .../java/com/alibaba/nacos/naming/core/Service.java | 10 +--------- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/console/src/main/resources/static/console-fe/src/locales/en-US.js b/console/src/main/resources/static/console-fe/src/locales/en-US.js index 7ab529a80..662113da5 100644 --- a/console/src/main/resources/static/console-fe/src/locales/en-US.js +++ b/console/src/main/resources/static/console-fe/src/locales/en-US.js @@ -101,7 +101,7 @@ const I18N_CONF = { columnClusterCount: 'Cluster Count', columnIpCount: 'Instance Count', columnHealthyInstanceCount: 'Healthy Instance Count', - columnTriggerFlag: 'Trigger Flag', + columnTriggerFlag: 'Trigger Protection Threshold', operation: 'Operation', detail: 'Details', sampleCode: 'Code Example', diff --git a/console/src/main/resources/static/console-fe/src/locales/zh-CN.js b/console/src/main/resources/static/console-fe/src/locales/zh-CN.js index c2fd5cec3..27a061b90 100644 --- a/console/src/main/resources/static/console-fe/src/locales/zh-CN.js +++ b/console/src/main/resources/static/console-fe/src/locales/zh-CN.js @@ -101,7 +101,7 @@ const I18N_CONF = { columnClusterCount: '集群数目', columnIpCount: '实例数', columnHealthyInstanceCount: '健康实例数', - columnTriggerFlag: '触发阈值', + columnTriggerFlag: '触发保护阈值', operation: '操作', detail: '详情', sampleCode: '示例代码', diff --git a/naming/src/main/java/com/alibaba/nacos/naming/core/Service.java b/naming/src/main/java/com/alibaba/nacos/naming/core/Service.java index b4956b32e..779a9e1f5 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/core/Service.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/core/Service.java @@ -192,15 +192,7 @@ public class Service extends com.alibaba.nacos.api.naming.pojo.Service implement } public boolean triggerFlag() { - if(0 == healthyInstanceCount()) { - return true; - } - Float compareValue = 0.0F; - if(Float.floatToIntBits(compareValue) == getProtectThreshold()) { - return false; - } - boolean triggerFlag = (healthyInstanceCount() * 1.0 / allIPs().size()) <= getProtectThreshold(); - return triggerFlag; + return (healthyInstanceCount() * 1.0 / allIPs().size()) <= getProtectThreshold(); } public void updateIPs(Collection instances, boolean ephemeral) { From 9cf3f5747e958149495ab7fc737036725a616d76 Mon Sep 17 00:00:00 2001 From: nkorange Date: Sat, 21 Sep 2019 15:09:19 +0800 Subject: [PATCH 12/22] Add synchronized when add/remove instance --- .../alibaba/nacos/naming/core/ServiceManager.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/naming/src/main/java/com/alibaba/nacos/naming/core/ServiceManager.java b/naming/src/main/java/com/alibaba/nacos/naming/core/ServiceManager.java index e0e854b80..a379a8e2b 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/core/ServiceManager.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/core/ServiceManager.java @@ -523,17 +523,22 @@ public class ServiceManager implements RecordListener { Service service = getService(namespaceId, serviceName); - List instanceList = addIpAddresses(service, ephemeral, ips); + synchronized (service) { + List instanceList = addIpAddresses(service, ephemeral, ips); - Instances instances = new Instances(); - instances.setInstanceList(instanceList); + Instances instances = new Instances(); + instances.setInstanceList(instanceList); - consistencyService.put(key, instances); + consistencyService.put(key, instances); + } } public void removeInstance(String namespaceId, String serviceName, boolean ephemeral, Instance... ips) throws NacosException { Service service = getService(namespaceId, serviceName); - removeInstance(namespaceId, serviceName, ephemeral, service, ips); + + synchronized (service) { + removeInstance(namespaceId, serviceName, ephemeral, service, ips); + } } public void removeInstance(String namespaceId, String serviceName, boolean ephemeral, Service service, Instance... ips) throws NacosException { From 0b66b0c6fd7b04de80d41e282bf8ddbeb5ab5152 Mon Sep 17 00:00:00 2001 From: nkorange Date: Tue, 24 Sep 2019 10:57:02 +0800 Subject: [PATCH 13/22] Update jackson version, see https://nvd.nist.gov/vuln/detail/CVE-2019-16335 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index bc8c1c00f..a9611dd96 100644 --- a/pom.xml +++ b/pom.xml @@ -668,13 +668,13 @@ com.fasterxml.jackson.core jackson-core - 2.9.9 + 2.9.10 com.fasterxml.jackson.core jackson-databind - 2.9.9 + 2.9.10 org.codehaus.jackson From 6b7b894a0decd53195ba125ef752bd3c167b5230 Mon Sep 17 00:00:00 2001 From: nkorange Date: Wed, 25 Sep 2019 15:46:34 +0800 Subject: [PATCH 14/22] Fix #1874 --- .../nacos/api/exception/NacosException.java | 4 + config/pom.xml | 4 + .../server/controller/ConfigController.java | 2 +- .../exception/GlobalExceptionHandler.java | 1 + .../server/exception/NacosException.java | 93 ------------------ .../config/server/service/PersistService.java | 2 +- .../nacos/config/server/utils/ParamUtils.java | 2 +- .../controller/NamespaceController.java | 2 +- .../naming/controllers/CatalogController.java | 2 +- .../naming/controllers/ClusterController.java | 2 +- .../naming/controllers/DistroController.java | 2 +- .../controllers/InstanceController.java | 2 +- .../naming/controllers/RaftController.java | 2 +- .../naming/controllers/ServiceController.java | 2 +- .../alibaba/nacos/naming/core/Instance.java | 2 +- .../naming/exception/NacosException.java | 95 ------------------- .../exception/ResponseExceptionHandler.java | 5 +- .../nacos/naming/misc/UtilsAndCommons.java | 2 +- .../nacos/naming/selector/LabelSelector.java | 2 +- .../controllers/ClusterControllerTest.java | 2 +- .../naming/selector/LabelSelectorTest.java | 3 +- 21 files changed, 27 insertions(+), 206 deletions(-) delete mode 100644 config/src/main/java/com/alibaba/nacos/config/server/exception/NacosException.java delete mode 100644 naming/src/main/java/com/alibaba/nacos/naming/exception/NacosException.java diff --git a/api/src/main/java/com/alibaba/nacos/api/exception/NacosException.java b/api/src/main/java/com/alibaba/nacos/api/exception/NacosException.java index f9fa85814..e2eca489a 100644 --- a/api/src/main/java/com/alibaba/nacos/api/exception/NacosException.java +++ b/api/src/main/java/com/alibaba/nacos/api/exception/NacosException.java @@ -123,6 +123,10 @@ public class NacosException extends Exception { * no right(鉴权失败) */ public static final int NO_RIGHT = 403; + /** + * not found + */ + public static final int NOT_FOUND = 404; /** * conflict(写并发冲突) */ diff --git a/config/pom.xml b/config/pom.xml index 68141b6b9..fe7aa30a2 100644 --- a/config/pom.xml +++ b/config/pom.xml @@ -42,6 +42,10 @@ org.springframework.boot spring-boot-starter-web + + ${project.groupId} + nacos-api + ${project.groupId} nacos-core diff --git a/config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigController.java b/config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigController.java index 668097b61..bc48d72e5 100644 --- a/config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigController.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigController.java @@ -16,7 +16,7 @@ package com.alibaba.nacos.config.server.controller; import com.alibaba.nacos.config.server.constant.Constants; -import com.alibaba.nacos.config.server.exception.NacosException; +import com.alibaba.nacos.api.exception.NacosException; import com.alibaba.nacos.config.server.model.*; import com.alibaba.nacos.config.server.result.ResultBuilder; import com.alibaba.nacos.config.server.result.code.ResultCodeEnum; diff --git a/config/src/main/java/com/alibaba/nacos/config/server/exception/GlobalExceptionHandler.java b/config/src/main/java/com/alibaba/nacos/config/server/exception/GlobalExceptionHandler.java index 5982213a1..7a52a8c2d 100644 --- a/config/src/main/java/com/alibaba/nacos/config/server/exception/GlobalExceptionHandler.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/exception/GlobalExceptionHandler.java @@ -15,6 +15,7 @@ */ package com.alibaba.nacos.config.server.exception; +import com.alibaba.nacos.api.exception.NacosException; import com.alibaba.nacos.config.server.monitor.MetricsMonitor; import org.springframework.dao.DataAccessException; import org.springframework.jdbc.CannotGetJdbcConnectionException; diff --git a/config/src/main/java/com/alibaba/nacos/config/server/exception/NacosException.java b/config/src/main/java/com/alibaba/nacos/config/server/exception/NacosException.java deleted file mode 100644 index d24d95867..000000000 --- a/config/src/main/java/com/alibaba/nacos/config/server/exception/NacosException.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.alibaba.nacos.config.server.exception; - -/** - * Nacos exception - * - * @author Nacos - */ -public class NacosException extends Exception { - - /** - * serialVersionUID - */ - private static final long serialVersionUID = -3913902031489277776L; - - private int errCode; - - private String errMsg; - - public NacosException() { - } - - public NacosException(int errCode, String errMsg) { - super(errMsg); - this.errCode = errCode; - this.errMsg = errMsg; - } - - public int getErrCode() { - return errCode; - } - - public String getErrMsg() { - return errMsg; - } - - public void setErrCode(int errCode) { - this.errCode = errCode; - } - - public void setErrMsg(String errMsg) { - this.errMsg = errMsg; - } - - @Override - public String toString() { - return "ErrCode:" + errCode + ",ErrMsg:" + errMsg; - } - - /** - * server error code, use http code 400 403 throw exception to user 500 502 - * 503 change ip and retry - */ - /** - * invalid param(参数错误) - */ - public static final int INVALID_PARAM = 400; - /** - * no right(鉴权失败) - */ - public static final int NO_RIGHT = 403; - /** - * conflict(写并发冲突) - */ - public static final int CONFLICT = 409; - /** - * server error(server异常,如超时) - */ - public static final int SERVER_ERROR = 500; - /** - * bad gateway(路由异常,如nginx后面的Server挂掉) - */ - public static final int BAD_GATEWAY = 502; - /** - * over threshold(超过server端的限流阈值) - */ - public static final int OVER_THRESHOLD = 503; - -} diff --git a/config/src/main/java/com/alibaba/nacos/config/server/service/PersistService.java b/config/src/main/java/com/alibaba/nacos/config/server/service/PersistService.java index 5fb623921..2cda8c7a1 100755 --- a/config/src/main/java/com/alibaba/nacos/config/server/service/PersistService.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/service/PersistService.java @@ -16,7 +16,7 @@ package com.alibaba.nacos.config.server.service; import com.alibaba.nacos.config.server.enums.FileTypeEnum; -import com.alibaba.nacos.config.server.exception.NacosException; +import com.alibaba.nacos.api.exception.NacosException; import com.alibaba.nacos.config.server.model.*; import com.alibaba.nacos.config.server.utils.LogUtil; import com.alibaba.nacos.config.server.utils.MD5; diff --git a/config/src/main/java/com/alibaba/nacos/config/server/utils/ParamUtils.java b/config/src/main/java/com/alibaba/nacos/config/server/utils/ParamUtils.java index 793810ed7..6292b5854 100644 --- a/config/src/main/java/com/alibaba/nacos/config/server/utils/ParamUtils.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/utils/ParamUtils.java @@ -17,7 +17,7 @@ package com.alibaba.nacos.config.server.utils; import java.util.Map; -import com.alibaba.nacos.config.server.exception.NacosException; +import com.alibaba.nacos.api.exception.NacosException; import org.apache.commons.lang3.StringUtils; diff --git a/console/src/main/java/com/alibaba/nacos/console/controller/NamespaceController.java b/console/src/main/java/com/alibaba/nacos/console/controller/NamespaceController.java index f74b38d2a..a6250e576 100644 --- a/console/src/main/java/com/alibaba/nacos/console/controller/NamespaceController.java +++ b/console/src/main/java/com/alibaba/nacos/console/controller/NamespaceController.java @@ -15,7 +15,7 @@ */ package com.alibaba.nacos.console.controller; -import com.alibaba.nacos.config.server.exception.NacosException; +import com.alibaba.nacos.api.exception.NacosException; import com.alibaba.nacos.config.server.model.RestResult; import com.alibaba.nacos.config.server.model.TenantInfo; import com.alibaba.nacos.config.server.service.PersistService; diff --git a/naming/src/main/java/com/alibaba/nacos/naming/controllers/CatalogController.java b/naming/src/main/java/com/alibaba/nacos/naming/controllers/CatalogController.java index 2b552b2eb..a9533845e 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/controllers/CatalogController.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/controllers/CatalogController.java @@ -25,7 +25,7 @@ import com.alibaba.nacos.core.utils.WebUtils; import com.alibaba.nacos.naming.core.Instance; import com.alibaba.nacos.naming.core.Service; import com.alibaba.nacos.naming.core.ServiceManager; -import com.alibaba.nacos.naming.exception.NacosException; +import com.alibaba.nacos.api.exception.NacosException; import com.alibaba.nacos.naming.healthcheck.HealthCheckTask; import com.alibaba.nacos.naming.misc.UtilsAndCommons; import com.alibaba.nacos.naming.pojo.ClusterInfo; diff --git a/naming/src/main/java/com/alibaba/nacos/naming/controllers/ClusterController.java b/naming/src/main/java/com/alibaba/nacos/naming/controllers/ClusterController.java index 8e2e0948c..32649ec2d 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/controllers/ClusterController.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/controllers/ClusterController.java @@ -24,7 +24,7 @@ import com.alibaba.nacos.core.utils.WebUtils; import com.alibaba.nacos.naming.core.Cluster; import com.alibaba.nacos.naming.core.Service; import com.alibaba.nacos.naming.core.ServiceManager; -import com.alibaba.nacos.naming.exception.NacosException; +import com.alibaba.nacos.api.exception.NacosException; import com.alibaba.nacos.naming.healthcheck.HealthCheckType; import com.alibaba.nacos.naming.misc.Loggers; import com.alibaba.nacos.naming.misc.UtilsAndCommons; diff --git a/naming/src/main/java/com/alibaba/nacos/naming/controllers/DistroController.java b/naming/src/main/java/com/alibaba/nacos/naming/controllers/DistroController.java index 3bf647277..a71e7eb85 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/controllers/DistroController.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/controllers/DistroController.java @@ -25,7 +25,7 @@ import com.alibaba.nacos.naming.consistency.ephemeral.distro.DataStore; import com.alibaba.nacos.naming.consistency.ephemeral.distro.DistroConsistencyServiceImpl; import com.alibaba.nacos.naming.core.Instances; import com.alibaba.nacos.naming.core.ServiceManager; -import com.alibaba.nacos.naming.exception.NacosException; +import com.alibaba.nacos.api.exception.NacosException; import com.alibaba.nacos.naming.misc.Loggers; import com.alibaba.nacos.naming.misc.SwitchDomain; import com.alibaba.nacos.naming.misc.UtilsAndCommons; diff --git a/naming/src/main/java/com/alibaba/nacos/naming/controllers/InstanceController.java b/naming/src/main/java/com/alibaba/nacos/naming/controllers/InstanceController.java index 4c846c33b..36881d41a 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/controllers/InstanceController.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/controllers/InstanceController.java @@ -26,7 +26,7 @@ import com.alibaba.nacos.naming.core.DistroMapper; import com.alibaba.nacos.naming.core.Instance; import com.alibaba.nacos.naming.core.Service; import com.alibaba.nacos.naming.core.ServiceManager; -import com.alibaba.nacos.naming.exception.NacosException; +import com.alibaba.nacos.api.exception.NacosException; import com.alibaba.nacos.naming.healthcheck.RsInfo; import com.alibaba.nacos.naming.misc.Loggers; import com.alibaba.nacos.naming.misc.SwitchDomain; diff --git a/naming/src/main/java/com/alibaba/nacos/naming/controllers/RaftController.java b/naming/src/main/java/com/alibaba/nacos/naming/controllers/RaftController.java index c2f1443b6..be16831a5 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/controllers/RaftController.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/controllers/RaftController.java @@ -30,7 +30,7 @@ import com.alibaba.nacos.naming.consistency.persistent.raft.RaftPeer; import com.alibaba.nacos.naming.core.Instances; import com.alibaba.nacos.naming.core.Service; import com.alibaba.nacos.naming.core.ServiceManager; -import com.alibaba.nacos.naming.exception.NacosException; +import com.alibaba.nacos.api.exception.NacosException; import com.alibaba.nacos.naming.misc.NetUtils; import com.alibaba.nacos.naming.misc.SwitchDomain; import com.alibaba.nacos.naming.misc.UtilsAndCommons; diff --git a/naming/src/main/java/com/alibaba/nacos/naming/controllers/ServiceController.java b/naming/src/main/java/com/alibaba/nacos/naming/controllers/ServiceController.java index 56067b19a..d89ff2e2b 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/controllers/ServiceController.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/controllers/ServiceController.java @@ -25,7 +25,7 @@ import com.alibaba.nacos.api.selector.SelectorType; import com.alibaba.nacos.core.utils.WebUtils; import com.alibaba.nacos.naming.cluster.ServerListManager; import com.alibaba.nacos.naming.core.*; -import com.alibaba.nacos.naming.exception.NacosException; +import com.alibaba.nacos.api.exception.NacosException; import com.alibaba.nacos.naming.misc.Loggers; import com.alibaba.nacos.naming.misc.UtilsAndCommons; import com.alibaba.nacos.naming.pojo.Subscriber; diff --git a/naming/src/main/java/com/alibaba/nacos/naming/core/Instance.java b/naming/src/main/java/com/alibaba/nacos/naming/core/Instance.java index 1e6419e11..7b7dcb588 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/core/Instance.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/core/Instance.java @@ -17,7 +17,7 @@ package com.alibaba.nacos.naming.core; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.annotation.JSONField; -import com.alibaba.nacos.naming.exception.NacosException; +import com.alibaba.nacos.api.exception.NacosException; import com.alibaba.nacos.naming.healthcheck.HealthCheckStatus; import com.alibaba.nacos.naming.misc.Loggers; import com.alibaba.nacos.naming.misc.UtilsAndCommons; diff --git a/naming/src/main/java/com/alibaba/nacos/naming/exception/NacosException.java b/naming/src/main/java/com/alibaba/nacos/naming/exception/NacosException.java deleted file mode 100644 index edc43187d..000000000 --- a/naming/src/main/java/com/alibaba/nacos/naming/exception/NacosException.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.alibaba.nacos.naming.exception; - -/** - * @author nkorange - */ -public class NacosException extends Exception { - - private static final long serialVersionUID = 266495151581594848L; - - private int errorCode; - - private String errorMsg; - - public NacosException() { - super(); - } - - public NacosException(int errorCode) { - super(); - this.errorCode = errorCode; - } - - public NacosException(int errorCode, String errorMsg) { - super(errorMsg); - this.errorCode = errorCode; - this.errorMsg = errorMsg; - } - - public NacosException(int errorCode, String msg, Throwable cause) { - super(msg, cause); - this.errorCode = errorCode; - } - - public NacosException(int errorCode, Throwable cause) { - super(cause); - this.errorCode = errorCode; - } - - public int getErrorCode() { - return errorCode; - } - - public String getErrorMsg() { - return errorMsg; - } - - /** - * server error code, use http code 400 403 throw exception to user 500 502 - * 503 change ip and retry - */ - /** - * invalid param - */ - public static final int INVALID_PARAM = 400; - /** - * no right - */ - public static final int NO_RIGHT = 403; - /** - * not found - */ - public static final int NOT_FOUND = 404; - - /** - * conflict - */ - public static final int CONFLICT = 409; - /** - * server error - */ - public static final int SERVER_ERROR = 500; - /** - * bad gateway - */ - public static final int BAD_GATEWAY = 502; - /** - * over threshold - */ - public static final int OVER_THRESHOLD = 503; -} diff --git a/naming/src/main/java/com/alibaba/nacos/naming/exception/ResponseExceptionHandler.java b/naming/src/main/java/com/alibaba/nacos/naming/exception/ResponseExceptionHandler.java index bd9ca3501..54bc43158 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/exception/ResponseExceptionHandler.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/exception/ResponseExceptionHandler.java @@ -15,6 +15,7 @@ */ package com.alibaba.nacos.naming.exception; +import com.alibaba.nacos.api.exception.NacosException; import com.alibaba.nacos.naming.misc.Loggers; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; @@ -30,8 +31,8 @@ public class ResponseExceptionHandler { @ExceptionHandler(NacosException.class) private ResponseEntity handleNacosException(NacosException e) { - Loggers.SRV_LOG.error("got exception. {}", e.getErrorMsg(), e); - return ResponseEntity.status(e.getErrorCode()).body(e.getMessage()); + Loggers.SRV_LOG.error("got exception. {}", e.getErrMsg(), e); + return ResponseEntity.status(e.getErrCode()).body(e.getMessage()); } @ExceptionHandler(IllegalArgumentException.class) diff --git a/naming/src/main/java/com/alibaba/nacos/naming/misc/UtilsAndCommons.java b/naming/src/main/java/com/alibaba/nacos/naming/misc/UtilsAndCommons.java index 9d0ed3b5e..f381a120f 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/misc/UtilsAndCommons.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/misc/UtilsAndCommons.java @@ -22,7 +22,7 @@ import com.alibaba.fastjson.serializer.SerializeConfig; import com.alibaba.fastjson.serializer.SerializerFeature; import com.alibaba.nacos.api.naming.pojo.AbstractHealthChecker; import com.alibaba.nacos.common.util.VersionUtils; -import com.alibaba.nacos.naming.exception.NacosException; +import com.alibaba.nacos.api.exception.NacosException; import com.alibaba.nacos.naming.healthcheck.JsonAdapter; import com.alibaba.nacos.naming.selector.Selector; import com.alibaba.nacos.naming.selector.SelectorJsonAdapter; diff --git a/naming/src/main/java/com/alibaba/nacos/naming/selector/LabelSelector.java b/naming/src/main/java/com/alibaba/nacos/naming/selector/LabelSelector.java index 88facd35f..5a089de02 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/selector/LabelSelector.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/selector/LabelSelector.java @@ -22,7 +22,7 @@ import com.alibaba.nacos.api.selector.SelectorType; import com.alibaba.nacos.cmdb.service.CmdbReader; import com.alibaba.nacos.naming.boot.SpringContext; import com.alibaba.nacos.naming.core.Instance; -import com.alibaba.nacos.naming.exception.NacosException; +import com.alibaba.nacos.api.exception.NacosException; import org.apache.commons.lang3.StringUtils; diff --git a/naming/src/test/java/com/alibaba/nacos/naming/controllers/ClusterControllerTest.java b/naming/src/test/java/com/alibaba/nacos/naming/controllers/ClusterControllerTest.java index bcdfac6a2..df25b3d25 100644 --- a/naming/src/test/java/com/alibaba/nacos/naming/controllers/ClusterControllerTest.java +++ b/naming/src/test/java/com/alibaba/nacos/naming/controllers/ClusterControllerTest.java @@ -16,10 +16,10 @@ package com.alibaba.nacos.naming.controllers; import com.alibaba.nacos.api.common.Constants; +import com.alibaba.nacos.api.exception.NacosException; import com.alibaba.nacos.naming.BaseTest; import com.alibaba.nacos.naming.core.Cluster; import com.alibaba.nacos.naming.core.Service; -import com.alibaba.nacos.naming.exception.NacosException; import com.alibaba.nacos.naming.misc.UtilsAndCommons; import org.junit.Assert; import org.junit.Before; diff --git a/naming/src/test/java/com/alibaba/nacos/naming/selector/LabelSelectorTest.java b/naming/src/test/java/com/alibaba/nacos/naming/selector/LabelSelectorTest.java index eb829d288..2f6437010 100644 --- a/naming/src/test/java/com/alibaba/nacos/naming/selector/LabelSelectorTest.java +++ b/naming/src/test/java/com/alibaba/nacos/naming/selector/LabelSelectorTest.java @@ -1,7 +1,6 @@ package com.alibaba.nacos.naming.selector; -import com.alibaba.nacos.naming.exception.NacosException; - +import com.alibaba.nacos.api.exception.NacosException; import org.apache.commons.lang3.StringUtils; import org.junit.Assert; import org.junit.Test; From f0c19859cec47f8d15680ac13b9086c1696b39dc Mon Sep 17 00:00:00 2001 From: nkorange Date: Wed, 25 Sep 2019 16:15:31 +0800 Subject: [PATCH 15/22] #1873, set default server expire timeout to 10 seconds and configurable. --- .../com/alibaba/nacos/naming/cluster/ServerListManager.java | 2 +- .../java/com/alibaba/nacos/naming/misc/SwitchDomain.java | 4 ++-- .../main/java/com/alibaba/nacos/naming/misc/SwitchEntry.java | 3 ++- .../java/com/alibaba/nacos/naming/misc/SwitchManager.java | 5 +++++ 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/naming/src/main/java/com/alibaba/nacos/naming/cluster/ServerListManager.java b/naming/src/main/java/com/alibaba/nacos/naming/cluster/ServerListManager.java index b6624a528..7caef5ff1 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/cluster/ServerListManager.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/cluster/ServerListManager.java @@ -73,7 +73,7 @@ public class ServerListManager { @PostConstruct public void init() { GlobalExecutor.registerServerListUpdater(new ServerListUpdater()); - GlobalExecutor.registerServerStatusReporter(new ServerStatusReporter(), 5000); + GlobalExecutor.registerServerStatusReporter(new ServerStatusReporter(), 2000); } private List refreshServerList() { diff --git a/naming/src/main/java/com/alibaba/nacos/naming/misc/SwitchDomain.java b/naming/src/main/java/com/alibaba/nacos/naming/misc/SwitchDomain.java index 162c938bd..17024eab5 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/misc/SwitchDomain.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/misc/SwitchDomain.java @@ -58,7 +58,7 @@ public class SwitchDomain implements Record, Cloneable { private List incrementalList = new ArrayList<>(); - private long serverStatusSynchronizationPeriodMillis = TimeUnit.SECONDS.toMillis(15); + private long serverStatusSynchronizationPeriodMillis = TimeUnit.SECONDS.toMillis(2); private long serviceStatusSynchronizationPeriodMillis = TimeUnit.SECONDS.toMillis(5); @@ -71,7 +71,7 @@ public class SwitchDomain implements Record, Cloneable { /** * The server is regarded as expired if its two reporting interval is lagger than this variable. */ - private long distroServerExpiredMillis = TimeUnit.SECONDS.toMillis(30); + private long distroServerExpiredMillis = TimeUnit.SECONDS.toMillis(10); /** * since which version, push can be enabled diff --git a/naming/src/main/java/com/alibaba/nacos/naming/misc/SwitchEntry.java b/naming/src/main/java/com/alibaba/nacos/naming/misc/SwitchEntry.java index f48a44f8a..55299e1c5 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/misc/SwitchEntry.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/misc/SwitchEntry.java @@ -46,7 +46,7 @@ public class SwitchEntry { public static final int MIN_PUSH_CACHE_TIME_MIILIS = 10000; public static final int MIN_CACHE_TIME_MIILIS = 1000; public static final int MIN_SERVICE_SYNC_TIME_MIILIS = 5000; - public static final int MIN_SERVER_SYNC_TIME_MIILIS = 15000; + public static final int MIN_SERVER_SYNC_TIME_MIILIS = 1000; public static final String ACTION_ADD = "add"; public static final String ACTION_REPLACE = "replace"; @@ -60,4 +60,5 @@ public class SwitchEntry { public static final String OVERRIDDEN_SERVER_STATUS = "overriddenServerStatus"; public static final String DEFAULT_INSTANCE_EPHEMERAL = "defaultInstanceEphemeral"; + public static final String DISTRO_SERVER_EXPIRED_MILLIS = "distroServerExpiredMillis"; } diff --git a/naming/src/main/java/com/alibaba/nacos/naming/misc/SwitchManager.java b/naming/src/main/java/com/alibaba/nacos/naming/misc/SwitchManager.java index e34192c56..65823b51b 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/misc/SwitchManager.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/misc/SwitchManager.java @@ -267,6 +267,11 @@ public class SwitchManager implements RecordListener { switchDomain.setDefaultInstanceEphemeral(Boolean.parseBoolean(defaultEphemeral)); } + if (entry.equals(SwitchEntry.DISTRO_SERVER_EXPIRED_MILLIS)) { + String distroServerExpiredMillis = value; + switchDomain.setDistroServerExpiredMillis(Long.parseLong(distroServerExpiredMillis)); + } + if (debug) { update(switchDomain); } else { From 71ce4dad4d2907f68651fe7a50b0254b79b29826 Mon Sep 17 00:00:00 2001 From: freekry Date: Fri, 30 Aug 2019 14:50:06 +0800 Subject: [PATCH 16/22] fix bug #1775 fix bug #1775 --- .../src/pages/ConfigurationManagement/NewConfig/NewConfig.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console/src/main/resources/static/console-fe/src/pages/ConfigurationManagement/NewConfig/NewConfig.js b/console/src/main/resources/static/console-fe/src/pages/ConfigurationManagement/NewConfig/NewConfig.js index 12836ad87..1a1cf0f5b 100644 --- a/console/src/main/resources/static/console-fe/src/pages/ConfigurationManagement/NewConfig/NewConfig.js +++ b/console/src/main/resources/static/console-fe/src/pages/ConfigurationManagement/NewConfig/NewConfig.js @@ -414,7 +414,7 @@ class NewConfig extends React.Component { label: 'YAML', }, { - value: 'text/html', + value: 'html', label: 'HTML', }, { From 4f85dc0df3e08663519879cbb9875b9adb1819a1 Mon Sep 17 00:00:00 2001 From: LoadChange Date: Wed, 25 Sep 2019 20:23:09 +0800 Subject: [PATCH 17/22] build fe --- console/src/main/resources/static/js/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/console/src/main/resources/static/js/main.js b/console/src/main/resources/static/js/main.js index b38e4016c..0d24bec1f 100644 --- a/console/src/main/resources/static/js/main.js +++ b/console/src/main/resources/static/js/main.js @@ -47,12 +47,12 @@ * * Date: 2019-04-08 */ -function(n){function d(e,t,n){var a="0x"+t-65536;return a!=a||n?t:a<0?String.fromCharCode(65536+a):String.fromCharCode(a>>10|55296,1023&a|56320)}function o(){w()}var e,f,b,r,i,h,p,m,M,l,u,w,k,s,S,g,c,y,_,T="sizzle"+1*new Date,v=n.document,C=0,a=0,x=le(),E=le(),L=le(),D=le(),N=function(e,t){return e===t&&(u=!0),0},O={}.hasOwnProperty,t=[],Y=t.pop,P=t.push,j=t.push,I=t.slice,A=function(e,t){for(var n=0,a=e.length;n+~]|"+H+")"+H+"*"),q=new RegExp(H+"|>"),G=new RegExp(W),J=new RegExp("^"+F+"$"),$={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+z),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+H+"*(even|odd|(([+-]|)(\\d*)n|)"+H+"*(?:([+-]|)"+H+"*(\\d+)|))"+H+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+H+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+H+"*((?:-\\d)?\\d*)"+H+"*\\)|)(?=[^-]|$)","i")},Q=/HTML$/i,X=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,ee=/^[^{]+\{\s*\[native \w/,te=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ne=/[+~]/,ae=new RegExp("\\\\([\\da-f]{1,6}"+H+"?|("+H+")|.)","ig"),oe=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,re=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},ie=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{j.apply(t=I.call(v.childNodes),v.childNodes),t[v.childNodes.length].nodeType}catch(e){j={apply:t.length?function(e,t){P.apply(e,I.call(t))}:function(e,t){for(var n=e.length,a=0;e[n++]=t[a++];);e.length=n-1}}}function se(t,e,n,a){var o,r,i,s,l,u,c,d=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!a&&((e?e.ownerDocument||e:v)!==k&&w(e),e=e||k,S)){if(11!==p&&(l=te.exec(t)))if(o=l[1]){if(9===p){if(!(i=e.getElementById(o)))return n;if(i.id===o)return n.push(i),n}else if(d&&(i=d.getElementById(o))&&_(e,i)&&i.id===o)return n.push(i),n}else{if(l[2])return j.apply(n,e.getElementsByTagName(t)),n;if((o=l[3])&&f.getElementsByClassName&&e.getElementsByClassName)return j.apply(n,e.getElementsByClassName(o)),n}if(f.qsa&&!D[t+" "]&&(!g||!g.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,d=e,1===p&&q.test(t)){for((s=e.getAttribute("id"))?s=s.replace(oe,re):e.setAttribute("id",s=T),r=(u=h(t)).length;r--;)u[r]="#"+s+" "+ve(u[r]);c=u.join(","),d=ne.test(t)&&ye(e.parentNode)||e}try{return j.apply(n,d.querySelectorAll(c)),n}catch(e){D(t,!0)}finally{s===T&&e.removeAttribute("id")}}}return m(t.replace(V,"$1"),e,n,a)}function le(){var a=[];return function e(t,n){return a.push(t+" ")>b.cacheLength&&delete e[a.shift()],e[t+" "]=n}}function ue(e){return e[T]=!0,e}function ce(e){var t=k.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function de(e,t){for(var n=e.split("|"),a=n.length;a--;)b.attrHandle[n[a]]=t}function pe(e,t){var n=t&&e,a=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(a)return a;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function fe(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function me(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ie(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ge(i){return ue(function(r){return r=+r,ue(function(e,t){for(var n,a=i([],e.length,r),o=a.length;o--;)e[n=a[o]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&void 0!==e.getElementsByTagName&&e}for(e in f=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Q.test(t||n&&n.nodeName||"HTML")},w=se.setDocument=function(e){var t,n,a=e?e.ownerDocument||e:v;return a!==k&&9===a.nodeType&&a.documentElement&&(s=(k=a).documentElement,S=!i(k),v!==k&&(n=k.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",o,!1):n.attachEvent&&n.attachEvent("onunload",o)),f.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),f.getElementsByTagName=ce(function(e){return e.appendChild(k.createComment("")),!e.getElementsByTagName("*").length}),f.getElementsByClassName=ee.test(k.getElementsByClassName),f.getById=ce(function(e){return s.appendChild(e).id=T,!k.getElementsByName||!k.getElementsByName(T).length}),f.getById?(b.filter.ID=function(e){var t=e.replace(ae,d);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if(void 0!==t.getElementById&&S){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(ae,d);return function(e){var t=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if(void 0!==t.getElementById&&S){var n,a,o,r=t.getElementById(e);if(r){if((n=r.getAttributeNode("id"))&&n.value===e)return[r];for(o=t.getElementsByName(e),a=0;r=o[a++];)if((n=r.getAttributeNode("id"))&&n.value===e)return[r]}return[]}}),b.find.TAG=f.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):f.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,a=[],o=0,r=t.getElementsByTagName(e);if("*"!==e)return r;for(;n=r[o++];)1===n.nodeType&&a.push(n);return a},b.find.CLASS=f.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&S)return t.getElementsByClassName(e)},c=[],g=[],(f.qsa=ee.test(k.querySelectorAll))&&(ce(function(e){s.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+H+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||g.push("\\["+H+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+T+"-]").length||g.push("~="),e.querySelectorAll(":checked").length||g.push(":checked"),e.querySelectorAll("a#"+T+"+*").length||g.push(".#.+[+~]")}),ce(function(e){e.innerHTML="";var t=k.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&g.push("name"+H+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),s.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(f.matchesSelector=ee.test(y=s.matches||s.webkitMatchesSelector||s.mozMatchesSelector||s.oMatchesSelector||s.msMatchesSelector))&&ce(function(e){f.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),c.push("!=",W)}),g=g.length&&new RegExp(g.join("|")),c=c.length&&new RegExp(c.join("|")),t=ee.test(s.compareDocumentPosition),_=t||ee.test(s.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,a=t&&t.parentNode;return e===a||!(!a||1!==a.nodeType||!(n.contains?n.contains(a):e.compareDocumentPosition&&16&e.compareDocumentPosition(a)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},N=t?function(e,t){if(e===t)return u=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!f.sortDetached&&t.compareDocumentPosition(e)===n?e===k||e.ownerDocument===v&&_(v,e)?-1:t===k||t.ownerDocument===v&&_(v,t)?1:l?A(l,e)-A(l,t):0:4&n?-1:1)}:function(e,t){if(e===t)return u=!0,0;var n,a=0,o=e.parentNode,r=t.parentNode,i=[e],s=[t];if(!o||!r)return e===k?-1:t===k?1:o?-1:r?1:l?A(l,e)-A(l,t):0;if(o===r)return pe(e,t);for(n=e;n=n.parentNode;)i.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;i[a]===s[a];)a++;return a?pe(i[a],s[a]):i[a]===v?-1:s[a]===v?1:0}),k},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==k&&w(e),f.matchesSelector&&S&&!D[t+" "]&&(!c||!c.test(t))&&(!g||!g.test(t)))try{var n=y.call(e,t);if(n||f.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){D(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(ae,d),e[3]=(e[3]||e[4]||e[5]||"").replace(ae,d),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return $.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&G.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(ae,d).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=x[e+" "];return t||(t=new RegExp("(^|"+H+")"+e+"("+H+"|$)"))&&x(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,a,o){return function(e){var t=se.attr(e,n);return null==t?"!="===a:!a||(t+="","="===a?t===o:"!="===a?t!==o:"^="===a?o&&0===t.indexOf(o):"*="===a?o&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function L(e,n,a){return v(n)?T.grep(e,function(e,t){return!!n.call(e,t,e)!==a}):n.nodeType?T.grep(e,function(e){return e===n!==a}):"string"!=typeof n?T.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(T.fn.init=function(e,t,n){var a,o;if(!e)return this;if(n=n||D,"string"!=typeof e)return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(T):T.makeArray(e,this);if(!(a="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:N.exec(e))||!a[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(a[1]){if(t=t instanceof T?t[0]:t,T.merge(this,T.parseHTML(a[1],t&&t.nodeType?t.ownerDocument||t:S,!0)),E.test(a[1])&&T.isPlainObject(t))for(a in t)v(this[a])?this[a](t[a]):this.attr(a,t[a]);return this}return(o=S.getElementById(a[2]))&&(this[0]=o,this.length=1),this}).prototype=T.fn,D=T(S);var O=/^(?:parents|prev(?:Until|All))/,Y={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}T.fn.extend({has:function(e){var t=T(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,fe=/^$|^module$|\/(?:java|ecma)script/i,he={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function me(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&x(e,t)?T.merge([e],n):n}function ge(e,t){for(var n=0,a=e.length;nx",_.noCloneChecked=!!ye.cloneNode(!0).lastChild.defaultValue;var Me=/^key/,we=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ke=/^([^.]*)(?:\.(.+)|)/;function Se(){return!0}function Te(){return!1}function Ce(e,t){return e===function(){try{return S.activeElement}catch(e){}}()==("focus"===t)}function xe(e,t,n,a,o,r){var i,s;if("object"==typeof t){for(s in"string"!=typeof n&&(a=a||n,n=void 0),t)xe(e,s,n,a,t[s],r);return e}if(null==a&&null==o?(o=n,a=n=void 0):null==o&&("string"==typeof n?(o=a,a=void 0):(o=a,a=n,n=void 0)),!1===o)o=Te;else if(!o)return e;return 1===r&&(i=o,(o=function(e){return T().off(e),i.apply(this,arguments)}).guid=i.guid||(i.guid=T.guid++)),e.each(function(){T.event.add(this,t,o,a,n)})}function Ee(e,o,r){r?(J.set(e,o,!1),T.event.add(e,o,{namespace:!1,handler:function(e){var t,n,a=J.get(this,o);if(1&e.isTrigger&&this[o]){if(a.length)(T.event.special[o]||{}).delegateType&&e.stopPropagation();else if(a=s.call(arguments),J.set(this,o,a),t=r(this,o),this[o](),a!==(n=J.get(this,o))||t?J.set(this,o,!1):n={},a!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else a.length&&(J.set(this,o,{value:T.event.trigger(T.extend(a[0],T.Event.prototype),a.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===J.get(e,o)&&T.event.add(e,o,Se)}T.event={global:{},add:function(t,e,n,a,o){var r,i,s,l,u,c,d,p,f,h,m,g=J.get(t);if(g)for(n.handler&&(n=(r=n).handler,o=r.selector),o&&T.find.matchesSelector(ae,o),n.guid||(n.guid=T.guid++),(l=g.events)||(l=g.events={}),(i=g.handle)||(i=g.handle=function(e){return void 0!==T&&T.event.triggered!==e.type?T.event.dispatch.apply(t,arguments):void 0}),u=(e=(e||"").match(j)||[""]).length;u--;)f=m=(s=ke.exec(e[u])||[])[1],h=(s[2]||"").split(".").sort(),f&&(d=T.event.special[f]||{},f=(o?d.delegateType:d.bindType)||f,d=T.event.special[f]||{},c=T.extend({type:f,origType:m,data:a,handler:n,guid:n.guid,selector:o,needsContext:o&&T.expr.match.needsContext.test(o),namespace:h.join(".")},r),(p=l[f])||((p=l[f]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(t,a,h,i)||t.addEventListener&&t.addEventListener(f,i)),d.add&&(d.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),o?p.splice(p.delegateCount++,0,c):p.push(c),T.event.global[f]=!0)},remove:function(e,t,n,a,o){var r,i,s,l,u,c,d,p,f,h,m,g=J.hasData(e)&&J.get(e);if(g&&(l=g.events)){for(u=(t=(t||"").match(j)||[""]).length;u--;)if(f=m=(s=ke.exec(t[u])||[])[1],h=(s[2]||"").split(".").sort(),f){for(d=T.event.special[f]||{},p=l[f=(a?d.delegateType:d.bindType)||f]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=r=p.length;r--;)c=p[r],!o&&m!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||a&&a!==c.selector&&("**"!==a||!c.selector)||(p.splice(r,1),c.selector&&p.delegateCount--,d.remove&&d.remove.call(e,c));i&&!p.length&&(d.teardown&&!1!==d.teardown.call(e,h,g.handle)||T.removeEvent(e,f,g.handle),delete l[f])}else for(f in l)T.event.remove(e,f+t[u],n,a,!0);T.isEmptyObject(l)&&J.remove(e,"handle events")}},dispatch:function(e){var t,n,a,o,r,i,s=T.event.fix(e),l=new Array(arguments.length),u=(J.get(this,"events")||{})[s.type]||[],c=T.event.special[s.type]||{};for(l[0]=s,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,De=/\s*$/g;function Ye(e,t){return x(e,"table")&&x(11!==t.nodeType?t:t.firstChild,"tr")&&T(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function je(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Ie(e,t){var n,a,o,r,i,s,l,u;if(1===t.nodeType){if(J.hasData(e)&&(r=J.access(e),i=J.set(t,r),u=r.events))for(o in delete i.handle,i.events={},u)for(n=0,a=u[o].length;n")},clone:function(e,t,n){var a,o,r,i,s,l,u,c=e.cloneNode(!0),d=oe(e);if(!(_.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||T.isXMLDoc(e)))for(i=me(c),a=0,o=(r=me(e)).length;a").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",o=function(e){a.remove(),o=null,e&&t("error"===e.type?404:200,e.type)}),S.head.appendChild(a[0])},abort:function(){o&&o()}}});var tn,nn=[],an=/(=)\?(?=&|$)|\?\?/;T.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=nn.pop()||T.expando+"_"+Yt++;return this[e]=!0,e}}),T.ajaxPrefilter("json jsonp",function(e,t,n){var a,o,r,i=!1!==e.jsonp&&(an.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&an.test(e.data)&&"data");if(i||"jsonp"===e.dataTypes[0])return a=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,i?e[i]=e[i].replace(an,"$1"+a):!1!==e.jsonp&&(e.url+=(Pt.test(e.url)?"&":"?")+e.jsonp+"="+a),e.converters["script json"]=function(){return r||T.error(a+" was not called"),r[0]},e.dataTypes[0]="json",o=k[a],k[a]=function(){r=arguments},n.always(function(){void 0===o?T(k).removeProp(a):k[a]=o,e[a]&&(e.jsonpCallback=t.jsonpCallback,nn.push(a)),r&&v(o)&&o(r[0]),r=o=void 0}),"script"}),_.createHTMLDocument=((tn=S.implementation.createHTMLDocument("").body).innerHTML="
",2===tn.childNodes.length),T.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(_.createHTMLDocument?((a=(t=S.implementation.createHTMLDocument("")).createElement("base")).href=S.location.href,t.head.appendChild(a)):t=S),r=!n&&[],(o=E.exec(e))?[t.createElement(o[1])]:(o=be([e],t,r),r&&r.length&&T(r).remove(),T.merge([],o.childNodes)));var a,o,r},T.fn.load=function(e,t,n){var a,o,r,i=this,s=e.indexOf(" ");return-1").append(T.parseHTML(e)).find(a):e)}).always(n&&function(e,t){i.each(function(){n.apply(this,r||[e.responseText,t,e])})}),this},T.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){T.fn[t]=function(e){return this.on(t,e)}}),T.expr.pseudos.animated=function(t){return T.grep(T.timers,function(e){return t===e.elem}).length},T.offset={setOffset:function(e,t,n){var a,o,r,i,s,l,u=T.css(e,"position"),c=T(e),d={};"static"===u&&(e.style.position="relative"),s=c.offset(),r=T.css(e,"top"),l=T.css(e,"left"),o=("absolute"===u||"fixed"===u)&&-1<(r+l).indexOf("auto")?(i=(a=c.position()).top,a.left):(i=parseFloat(r)||0,parseFloat(l)||0),v(t)&&(t=t.call(e,n,T.extend({},s))),null!=t.top&&(d.top=t.top-s.top+i),null!=t.left&&(d.left=t.left-s.left+o),"using"in t?t.using.call(e,d):c.css(d)}},T.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){T.offset.setOffset(this,t,e)});var e,n,a=this[0];return a?a.getClientRects().length?(e=a.getBoundingClientRect(),n=a.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,a=this[0],o={top:0,left:0};if("fixed"===T.css(a,"position"))t=a.getBoundingClientRect();else{for(t=this.offset(),n=a.ownerDocument,e=a.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===T.css(e,"position");)e=e.parentNode;e&&e!==a&&1===e.nodeType&&((o=T(e).offset()).top+=T.css(e,"borderTopWidth",!0),o.left+=T.css(e,"borderLeftWidth",!0))}return{top:t.top-o.top-T.css(a,"marginTop",!0),left:t.left-o.left-T.css(a,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===T.css(e,"position");)e=e.offsetParent;return e||ae})}}),T.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,o){var r="pageYOffset"===o;T.fn[t]=function(e){return W(this,function(e,t,n){var a;if(m(e)?a=e:9===e.nodeType&&(a=e.defaultView),void 0===n)return a?a[o]:e[t];a?a.scrollTo(r?a.pageXOffset:n,r?n:a.pageYOffset):e[t]=n},t,e,arguments.length)}}),T.each(["top","left"],function(e,n){T.cssHooks[n]=Xe(_.pixelPosition,function(e,t){if(t)return t=Qe(e,n),Ke.test(t)?T(e).position()[n]+"px":t})}),T.each({Height:"height",Width:"width"},function(i,s){T.each({padding:"inner"+i,content:s,"":"outer"+i},function(a,r){T.fn[r]=function(e,t){var n=arguments.length&&(a||"boolean"!=typeof e),o=a||(!0===e||!0===t?"margin":"border");return W(this,function(e,t,n){var a;return m(e)?0===r.indexOf("outer")?e["inner"+i]:e.document.documentElement["client"+i]:9===e.nodeType?(a=e.documentElement,Math.max(e.body["scroll"+i],a["scroll"+i],e.body["offset"+i],a["offset"+i],a["client"+i])):void 0===n?T.css(e,t,o):T.style(e,t,n,o)},s,n?e:void 0,n)}})}),T.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){T.fn[n]=function(e,t){return 0, or explicitly pass "'+h+'" as a prop to "'+o+'".'),n.initSelector(),n.initSubscription(),n}w(e,a);var t=e.prototype;return t.getChildContext=function(){var e,t=this.propsMode?null:this.subscription;return(e={})[_]=t||this.context[_],e},t.componentDidMount=function(){p&&(this.subscription.trySubscribe(),this.selector.run(this.props),this.selector.shouldComponentUpdate&&this.forceUpdate())},t.componentWillReceiveProps=function(e){this.selector.run(e)},t.shouldComponentUpdate=function(){return this.selector.shouldComponentUpdate},t.componentWillUnmount=function(){this.subscription&&this.subscription.tryUnsubscribe(),this.subscription=null,this.notifyNestedSubs=j,this.store=null,this.selector.run=j,this.selector.shouldComponentUpdate=!1},t.getWrappedInstance=function(){return D()(g,"To access the wrapped instance, you need to specify { withRef: true } in the options argument of the "+l+"() call."),this.wrappedInstance},t.setWrappedInstance=function(e){this.wrappedInstance=e},t.initSelector=function(){var e=i(this.store.dispatch,r);this.selector=function(n,a){var o={run:function(e){try{var t=n(a.getState(),e);t===o.props&&!o.error||(o.shouldComponentUpdate=!0,o.props=t,o.error=null)}catch(e){o.shouldComponentUpdate=!0,o.error=e}}};return o}(e,this.store),this.selector.run(this.props)},t.initSubscription=function(){if(p){var e=(this.propsMode?this.props:this.context)[_];this.subscription=new O(this.store,e,this.onStateChange.bind(this)),this.notifyNestedSubs=this.subscription.notifyNestedSubs.bind(this.subscription)}},t.onStateChange=function(){this.selector.run(this.props),this.selector.shouldComponentUpdate?(this.componentDidUpdate=this.notifyNestedSubsOnComponentDidUpdate,this.setState(P)):this.notifyNestedSubs()},t.notifyNestedSubsOnComponentDidUpdate=function(){this.componentDidUpdate=void 0,this.notifyNestedSubs()},t.isSubscribed=function(){return Boolean(this.subscription)&&this.subscription.isSubscribed()},t.addExtraProps=function(e){if(!(g||c||this.propsMode&&this.subscription))return e;var t=Object(x.a)({},e);return g&&(t.ref=this.setWrappedInstance),c&&(t[c]=this.renderCount++),this.propsMode&&this.subscription&&(t[_]=this.subscription),t},t.render=function(){var e=this.selector;if(e.shouldComponentUpdate=!1,e.error)throw e.error;return Object(k.createElement)(n,this.addExtraProps(e.props))},e}(k.Component);return t.WrappedComponent=n,t.displayName=o,t.childContextTypes=M,t.contextTypes=b,t.propTypes=b,L()(t,n)}}var c=Object.prototype.hasOwnProperty;function d(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function v(e,t){if(d(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(var o=0;othis.menuNode.clientHeight)){var e=this.menuNode.clientHeight+this.menuNode.scrollTop,t=this.itemNode.offsetTop+this.itemNode.offsetHeight;e"===(c=e.charAt(r+1))){o+="(",r++,0[0-9][0-9][0-9][0-9])-(?[0-9][0-9]?)-(?[0-9][0-9]?)(?:(?:[Tt]|[ \t]+)(?[0-9][0-9]?):(?[0-9][0-9]):(?[0-9][0-9])(?:.(?[0-9]*))?(?:[ \t]*(?Z|(?[-+])(?[0-9][0-9]?)(?::(?[0-9][0-9]))?))?)?$","i"),r.LOCAL_TIMEZONE_OFFSET=60*(new Date).getTimezoneOffset()*1e3,r.trim=function(e,t){var n,a;return null==t&&(t="\\s"),null==(n=this.REGEX_LEFT_TRIM_BY_CHAR[t])&&(this.REGEX_LEFT_TRIM_BY_CHAR[t]=n=new RegExp("^"+t+t+"*")),n.lastIndex=0,null==(a=this.REGEX_RIGHT_TRIM_BY_CHAR[t])&&(this.REGEX_RIGHT_TRIM_BY_CHAR[t]=a=new RegExp(t+""+t+"*$")),a.lastIndex=0,e.replace(n,"").replace(a,"")},r.ltrim=function(e,t){var n;return null==t&&(t="\\s"),null==(n=this.REGEX_LEFT_TRIM_BY_CHAR[t])&&(this.REGEX_LEFT_TRIM_BY_CHAR[t]=n=new RegExp("^"+t+t+"*")),n.lastIndex=0,e.replace(n,"")},r.rtrim=function(e,t){var n;return null==t&&(t="\\s"),null==(n=this.REGEX_RIGHT_TRIM_BY_CHAR[t])&&(this.REGEX_RIGHT_TRIM_BY_CHAR[t]=n=new RegExp(t+""+t+"*$")),n.lastIndex=0,e.replace(n,"")},r.isEmpty=function(e){return!e||""===e||"0"===e||e instanceof Array&&0===e.length||this.isEmptyObject(e)},r.isEmptyObject=function(t){var n;return t instanceof Object&&0===function(){var e;for(n in e=[],t)o.call(t,n)&&e.push(n);return e}().length},r.subStrCount=function(e,t,n,a){var o,r,i,s,l,u;for(o=0,e=""+e,t=""+t,null!=n&&(e=e.slice(n)),null!=a&&(e=e.slice(0,a)),s=e.length,u=t.length,r=i=0,l=s;0<=l?i>6)+t(128|63&e):e<65536?t(224|e>>12)+t(128|e>>6&63)+t(128|63&e):t(240|e>>18)+t(128|e>>12&63)+t(128|e>>6&63)+t(128|63&e)},r.parseBoolean=function(e,t){var n;return null==t&&(t=!0),"string"==typeof e?(n=e.toLowerCase(),!(!t&&"no"===n)&&"0"!==n&&"false"!==n&&""!==n):!!e},r.isNumeric=function(e){return this.REGEX_SPACES.lastIndex=0,"number"==typeof e||"string"==typeof e&&!isNaN(e)&&""!==e.replace(this.REGEX_SPACES,"")},r.stringToDate=function(e){var t,n,a,o,r,i,s,l,u,c;if(!(null!=e?e.length:void 0))return null;if(!(r=this.PATTERN_DATE.exec(e)))return null;if(c=parseInt(r.year,10),s=parseInt(r.month,10)-1,n=parseInt(r.day,10),null==r.hour)return t=new Date(Date.UTC(c,s,n));if(o=parseInt(r.hour,10),i=parseInt(r.minute,10),l=parseInt(r.second,10),null!=r.fraction){for(a=r.fraction.slice(0,3);a.length<3;)a+="0";a=parseInt(a,10)}else a=0;return null!=r.tz&&(u=6e4*(60*parseInt(r.tz_hour,10)+(null!=r.tz_minute?parseInt(r.tz_minute,10):0)),"-"===r.tz_sign&&(u*=-1)),t=new Date(Date.UTC(c,s,n,o,i,l,a)),u&&t.setTime(t.getTime()-u),t},r.strRepeat=function(e,t){var n,a;for(a="",n=0;n or withRouter() outside a ");var l=t.route,u=(a||l.location).pathname;return Object(p.a)(u,{path:o,strict:r,exact:i,sensitive:s},l.match)},y.prototype.componentWillMount=function(){o()(!(this.props.component&&this.props.render),"You should not use and in the same route; will be ignored"),o()(!(this.props.component&&this.props.children&&!h(this.props.children)),"You should not use and in the same route; will be ignored"),o()(!(this.props.render&&this.props.children&&!h(this.props.children)),"You should not use and in the same route; will be ignored")},y.prototype.componentWillReceiveProps=function(e,t){o()(!(e.location&&!this.props.location),' elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'),o()(!(!e.location&&this.props.location),' elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.'),this.setState({match:this.computeMatch(e,t.router)})},y.prototype.render=function(){var e=this.state.match,t=this.props,n=t.children,a=t.component,o=t.render,r=this.context.router,i=r.history,s=r.route,l=r.staticContext,u={match:e,location:this.props.location||s.location,history:i,staticContext:l};return a?e?d.a.createElement(a,u):null:o?e?o(u):null:"function"==typeof n?n(u):n&&!h(n)?d.a.Children.only(n):null},y);function y(){var e,t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,y);for(var n=arguments.length,a=Array(n),o=0;odocument.F=Object<\/script>"),e.close(),c=e.F;n--;)delete c[u][s[n]];return c()};e.exports=Object.create||function(e,t){var n;return null!==e?(o[u]=r(e),n=new o,o[u]=null,n[l]=e):n=c(),void 0===t?n:i(n,t)}},function(e,t,n){var a=n(75).f,o=n(70),r=n(78)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,r)&&a(e,r,{configurable:!0,value:t})}},function(e,t,n){t.f=n(78)},function(e,t,n){var a=n(60),o=n(68),r=n(102),i=n(132),s=n(75).f;e.exports=function(e){var t=o.Symbol||(o.Symbol=r?{}:a.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:i.f(e)})}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(t,e){if(!t)return null;if("string"==typeof t)return document.getElementById(t);"function"==typeof t&&(t=t(e));if(!t)return null;try{return(0,a.findDOMNode)(t)}catch(e){return t}};var a=n(25);e.exports=t.default},function(e,t,n){"use strict";n(67),n(453)},function(e,t,n){"use strict";function l(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}function u(n){this.setState(function(e){var t=this.constructor.getDerivedStateFromProps(n,e);return null!=t?t:null}.bind(this))}function c(e,t){try{var n=this.props,a=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,a)}finally{this.props=n,this.state=a}}function a(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if("function"!=typeof e.getDerivedStateFromProps&&"function"!=typeof t.getSnapshotBeforeUpdate)return e;var n=null,a=null,o=null;if("function"==typeof t.componentWillMount?n="componentWillMount":"function"==typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"==typeof t.componentWillReceiveProps?a="componentWillReceiveProps":"function"==typeof t.UNSAFE_componentWillReceiveProps&&(a="UNSAFE_componentWillReceiveProps"),"function"==typeof t.componentWillUpdate?o="componentWillUpdate":"function"==typeof t.UNSAFE_componentWillUpdate&&(o="UNSAFE_componentWillUpdate"),null!==n||null!==a||null!==o){var r=e.displayName||e.name,i="function"==typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+r+" uses "+i+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==a?"\n "+a:"")+(null!==o?"\n "+o:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"==typeof e.getDerivedStateFromProps&&(t.componentWillMount=l,t.componentWillReceiveProps=u),"function"==typeof t.getSnapshotBeforeUpdate){if("function"!=typeof t.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=c;var s=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var a=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;s.call(this,e,t,a)}}return e}n.r(t),n.d(t,"polyfill",function(){return a}),c.__suppressDeprecationWarning=u.__suppressDeprecationWarning=l.__suppressDeprecationWarning=!0},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var a,o,h=d(n(5)),r=d(n(4)),i=d(n(6)),s=d(n(7)),l=n(0),m=d(l),u=d(n(2)),g=d(n(12)),y=d(n(23)),c=n(11),_=d(n(93));function d(e){return e&&e.__esModule?e:{default:e}}var p,f=c.func.bindCtx,v=c.obj.pickOthers,b=(p=l.Component,(0,s.default)(M,p),M.prototype.getSelected=function(){var e=this.props,t=e._key,n=e.root,a=e.selected,o=n.props.selectMode,r=n.state.selectedKeys;return a||!!o&&-1=d,T=(0,P.default)(((t={})[o+"upload-inner"]=!0,t[o+"hidden"]=S,t)),C=this.props.children;if("card"===i){var x,E=(0,P.default)(((x={})[o+"upload-card"]=!0,x[o+"disabled"]=c,x));C=Y.default.createElement("div",{className:E},Y.default.createElement(I.default,{type:"add",size:"large"}),Y.default.createElement("div",{tabIndex:"0",role:"button",className:o+"upload-text"},C))}var L=c?j.func.prevent:m,D=j.obj.pickAttrsWith(this.props,"data-");return Y.default.createElement("div",(0,N.default)({className:k,style:l},D),Y.default.createElement(A.default,(0,N.default)({},w,{beforeUpload:f,dragable:r,disabled:c||S,className:T,onSelect:this.onSelect,onDrop:this.onDrop,onProgress:this.onProgress,onSuccess:this.onSuccess,onError:this.onError,ref:this.saveUploaderRef}),C),a||_?Y.default.createElement(R.default,{useDataURL:u,uploader:this,listType:a,value:this.state.value,closable:p,onRemove:L,progressProps:b,onCancel:g,onPreview:y,extraRender:v,rtl:M}):null)},o=a=y,a.displayName="Upload",a.propTypes=(0,N.default)({},d.default.propTypes,R.default.propTypes,{prefix:u.default.string.isRequired,action:u.default.string,value:u.default.array,defaultValue:u.default.array,shape:u.default.oneOf(["card"]),listType:u.default.oneOf(["text","image","card"]),list:u.default.any,name:u.default.string,data:u.default.oneOfType([u.default.object,u.default.func]),formatter:u.default.func,limit:u.default.number,timeout:u.default.number,dragable:u.default.bool,closable:u.default.bool,useDataURL:u.default.bool,disabled:u.default.bool,onSelect:u.default.func,onProgress:u.default.func,onChange:u.default.func,onSuccess:u.default.func,afterSelect:u.default.func,onRemove:u.default.func,onError:u.default.func,beforeUpload:u.default.func,onDrop:u.default.func,className:u.default.string,style:u.default.object,children:u.default.node,autoUpload:u.default.bool,request:u.default.func,progressProps:u.default.object,rtl:u.default.bool}),a.defaultProps=(0,N.default)({},d.default.defaultProps,{prefix:"next-",limit:1/0,autoUpload:!0,closable:!0,onSelect:m,onProgress:m,onChange:m,onSuccess:m,onRemove:m,onError:m,onDrop:m,beforeUpload:m,afterSelect:m}),r=function(){var p=this;this.onSelect=function(e){var t=p.props,n=t.autoUpload,a=t.afterSelect,o=t.onSelect,r=t.limit,i=p.state.value.length+e.length,s=r-p.state.value.length;if(!(s<=0)){var l=e.map(function(e){var t=(0,f.fileToObject)(e);return t.state="selected",t}),u=l,c=[];ro;)i(a,n=t[o++])&&(~l(r,n)||r.push(n));return r}},function(e,t,n){var a=n(159);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==a(e)?e.split(""):Object(e)}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){"use strict";function v(){return this}var b=n(102),M=n(89),w=n(161),k=n(74),S=n(129),T=n(404),C=n(131),x=n(407),E=n(78)("iterator"),L=!([].keys&&"next"in[].keys()),D="values";e.exports=function(e,t,n,a,o,r,i){T(n,t,a);function s(e){if(!L&&e in h)return h[e];switch(e){case"keys":case D:return function(){return new n(this,e)}}return function(){return new n(this,e)}}var l,u,c,d=t+" Iterator",p=o==D,f=!1,h=e.prototype,m=h[E]||h["@@iterator"]||o&&h[o],g=m||s(o),y=o?p?s("entries"):g:void 0,_="Array"==t&&h.entries||m;if(_&&(c=x(_.call(new e)))!==Object.prototype&&c.next&&(C(c,d,!0),b||"function"==typeof c[E]||k(c,E,v)),p&&m&&m.name!==D&&(f=!0,g=function(){return m.call(this)}),b&&!i||!L&&!f&&h[E]||k(h,E,g),S[t]=g,S[d]=v,o)if(l={values:p?g:s(D),keys:r?g:s("keys"),entries:y},i)for(u in l)u in h||w(h,u,l[u]);else M(M.P+M.F*(L||f),t,l);return l}},function(e,t,n){e.exports=n(74)},function(e,t,n){var a=n(157),o=n(126).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return a(e,o)}},function(e,t,n){var a=n(104),o=n(100),r=n(77),i=n(121),s=n(70),l=n(155),u=Object.getOwnPropertyDescriptor;t.f=n(69)?u:function(e,t){if(e=r(e),t=i(t,!0),l)try{return u(e,t)}catch(e){}if(s(e,t))return o(!a.f.call(e,t),e[t])}},function(e,t,n){"use strict"; +function(n){function d(e,t,n){var a="0x"+t-65536;return a!=a||n?t:a<0?String.fromCharCode(65536+a):String.fromCharCode(a>>10|55296,1023&a|56320)}function o(){w()}var e,f,b,r,i,h,p,m,M,l,u,w,k,s,S,g,c,y,_,T="sizzle"+1*new Date,v=n.document,C=0,a=0,x=le(),E=le(),L=le(),D=le(),N=function(e,t){return e===t&&(u=!0),0},O={}.hasOwnProperty,t=[],Y=t.pop,P=t.push,j=t.push,I=t.slice,A=function(e,t){for(var n=0,a=e.length;n+~]|"+H+")"+H+"*"),q=new RegExp(H+"|>"),G=new RegExp(W),J=new RegExp("^"+F+"$"),$={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+z),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+H+"*(even|odd|(([+-]|)(\\d*)n|)"+H+"*(?:([+-]|)"+H+"*(\\d+)|))"+H+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+H+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+H+"*((?:-\\d)?\\d*)"+H+"*\\)|)(?=[^-]|$)","i")},Q=/HTML$/i,X=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,ee=/^[^{]+\{\s*\[native \w/,te=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ne=/[+~]/,ae=new RegExp("\\\\([\\da-f]{1,6}"+H+"?|("+H+")|.)","ig"),oe=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,re=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},ie=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{j.apply(t=I.call(v.childNodes),v.childNodes),t[v.childNodes.length].nodeType}catch(e){j={apply:t.length?function(e,t){P.apply(e,I.call(t))}:function(e,t){for(var n=e.length,a=0;e[n++]=t[a++];);e.length=n-1}}}function se(t,e,n,a){var o,r,i,s,l,u,c,d=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!a&&((e?e.ownerDocument||e:v)!==k&&w(e),e=e||k,S)){if(11!==p&&(l=te.exec(t)))if(o=l[1]){if(9===p){if(!(i=e.getElementById(o)))return n;if(i.id===o)return n.push(i),n}else if(d&&(i=d.getElementById(o))&&_(e,i)&&i.id===o)return n.push(i),n}else{if(l[2])return j.apply(n,e.getElementsByTagName(t)),n;if((o=l[3])&&f.getElementsByClassName&&e.getElementsByClassName)return j.apply(n,e.getElementsByClassName(o)),n}if(f.qsa&&!D[t+" "]&&(!g||!g.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,d=e,1===p&&q.test(t)){for((s=e.getAttribute("id"))?s=s.replace(oe,re):e.setAttribute("id",s=T),r=(u=h(t)).length;r--;)u[r]="#"+s+" "+ve(u[r]);c=u.join(","),d=ne.test(t)&&ye(e.parentNode)||e}try{return j.apply(n,d.querySelectorAll(c)),n}catch(e){D(t,!0)}finally{s===T&&e.removeAttribute("id")}}}return m(t.replace(V,"$1"),e,n,a)}function le(){var a=[];return function e(t,n){return a.push(t+" ")>b.cacheLength&&delete e[a.shift()],e[t+" "]=n}}function ue(e){return e[T]=!0,e}function ce(e){var t=k.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function de(e,t){for(var n=e.split("|"),a=n.length;a--;)b.attrHandle[n[a]]=t}function pe(e,t){var n=t&&e,a=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(a)return a;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function fe(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function me(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ie(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ge(i){return ue(function(r){return r=+r,ue(function(e,t){for(var n,a=i([],e.length,r),o=a.length;o--;)e[n=a[o]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&void 0!==e.getElementsByTagName&&e}for(e in f=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Q.test(t||n&&n.nodeName||"HTML")},w=se.setDocument=function(e){var t,n,a=e?e.ownerDocument||e:v;return a!==k&&9===a.nodeType&&a.documentElement&&(s=(k=a).documentElement,S=!i(k),v!==k&&(n=k.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",o,!1):n.attachEvent&&n.attachEvent("onunload",o)),f.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),f.getElementsByTagName=ce(function(e){return e.appendChild(k.createComment("")),!e.getElementsByTagName("*").length}),f.getElementsByClassName=ee.test(k.getElementsByClassName),f.getById=ce(function(e){return s.appendChild(e).id=T,!k.getElementsByName||!k.getElementsByName(T).length}),f.getById?(b.filter.ID=function(e){var t=e.replace(ae,d);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if(void 0!==t.getElementById&&S){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(ae,d);return function(e){var t=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if(void 0!==t.getElementById&&S){var n,a,o,r=t.getElementById(e);if(r){if((n=r.getAttributeNode("id"))&&n.value===e)return[r];for(o=t.getElementsByName(e),a=0;r=o[a++];)if((n=r.getAttributeNode("id"))&&n.value===e)return[r]}return[]}}),b.find.TAG=f.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):f.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,a=[],o=0,r=t.getElementsByTagName(e);if("*"!==e)return r;for(;n=r[o++];)1===n.nodeType&&a.push(n);return a},b.find.CLASS=f.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&S)return t.getElementsByClassName(e)},c=[],g=[],(f.qsa=ee.test(k.querySelectorAll))&&(ce(function(e){s.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+H+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||g.push("\\["+H+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+T+"-]").length||g.push("~="),e.querySelectorAll(":checked").length||g.push(":checked"),e.querySelectorAll("a#"+T+"+*").length||g.push(".#.+[+~]")}),ce(function(e){e.innerHTML="";var t=k.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&g.push("name"+H+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),s.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(f.matchesSelector=ee.test(y=s.matches||s.webkitMatchesSelector||s.mozMatchesSelector||s.oMatchesSelector||s.msMatchesSelector))&&ce(function(e){f.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),c.push("!=",W)}),g=g.length&&new RegExp(g.join("|")),c=c.length&&new RegExp(c.join("|")),t=ee.test(s.compareDocumentPosition),_=t||ee.test(s.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,a=t&&t.parentNode;return e===a||!(!a||1!==a.nodeType||!(n.contains?n.contains(a):e.compareDocumentPosition&&16&e.compareDocumentPosition(a)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},N=t?function(e,t){if(e===t)return u=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!f.sortDetached&&t.compareDocumentPosition(e)===n?e===k||e.ownerDocument===v&&_(v,e)?-1:t===k||t.ownerDocument===v&&_(v,t)?1:l?A(l,e)-A(l,t):0:4&n?-1:1)}:function(e,t){if(e===t)return u=!0,0;var n,a=0,o=e.parentNode,r=t.parentNode,i=[e],s=[t];if(!o||!r)return e===k?-1:t===k?1:o?-1:r?1:l?A(l,e)-A(l,t):0;if(o===r)return pe(e,t);for(n=e;n=n.parentNode;)i.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;i[a]===s[a];)a++;return a?pe(i[a],s[a]):i[a]===v?-1:s[a]===v?1:0}),k},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==k&&w(e),f.matchesSelector&&S&&!D[t+" "]&&(!c||!c.test(t))&&(!g||!g.test(t)))try{var n=y.call(e,t);if(n||f.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){D(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(ae,d),e[3]=(e[3]||e[4]||e[5]||"").replace(ae,d),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return $.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&G.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(ae,d).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=x[e+" "];return t||(t=new RegExp("(^|"+H+")"+e+"("+H+"|$)"))&&x(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,a,o){return function(e){var t=se.attr(e,n);return null==t?"!="===a:!a||(t+="","="===a?t===o:"!="===a?t!==o:"^="===a?o&&0===t.indexOf(o):"*="===a?o&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function L(e,n,a){return v(n)?T.grep(e,function(e,t){return!!n.call(e,t,e)!==a}):n.nodeType?T.grep(e,function(e){return e===n!==a}):"string"!=typeof n?T.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(T.fn.init=function(e,t,n){var a,o;if(!e)return this;if(n=n||D,"string"!=typeof e)return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(T):T.makeArray(e,this);if(!(a="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:N.exec(e))||!a[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(a[1]){if(t=t instanceof T?t[0]:t,T.merge(this,T.parseHTML(a[1],t&&t.nodeType?t.ownerDocument||t:S,!0)),E.test(a[1])&&T.isPlainObject(t))for(a in t)v(this[a])?this[a](t[a]):this.attr(a,t[a]);return this}return(o=S.getElementById(a[2]))&&(this[0]=o,this.length=1),this}).prototype=T.fn,D=T(S);var O=/^(?:parents|prev(?:Until|All))/,Y={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}T.fn.extend({has:function(e){var t=T(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,fe=/^$|^module$|\/(?:java|ecma)script/i,he={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function me(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&x(e,t)?T.merge([e],n):n}function ge(e,t){for(var n=0,a=e.length;nx",_.noCloneChecked=!!ye.cloneNode(!0).lastChild.defaultValue;var Me=/^key/,we=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ke=/^([^.]*)(?:\.(.+)|)/;function Se(){return!0}function Te(){return!1}function Ce(e,t){return e===function(){try{return S.activeElement}catch(e){}}()==("focus"===t)}function xe(e,t,n,a,o,r){var i,s;if("object"==typeof t){for(s in"string"!=typeof n&&(a=a||n,n=void 0),t)xe(e,s,n,a,t[s],r);return e}if(null==a&&null==o?(o=n,a=n=void 0):null==o&&("string"==typeof n?(o=a,a=void 0):(o=a,a=n,n=void 0)),!1===o)o=Te;else if(!o)return e;return 1===r&&(i=o,(o=function(e){return T().off(e),i.apply(this,arguments)}).guid=i.guid||(i.guid=T.guid++)),e.each(function(){T.event.add(this,t,o,a,n)})}function Ee(e,o,r){r?(J.set(e,o,!1),T.event.add(e,o,{namespace:!1,handler:function(e){var t,n,a=J.get(this,o);if(1&e.isTrigger&&this[o]){if(a.length)(T.event.special[o]||{}).delegateType&&e.stopPropagation();else if(a=s.call(arguments),J.set(this,o,a),t=r(this,o),this[o](),a!==(n=J.get(this,o))||t?J.set(this,o,!1):n={},a!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else a.length&&(J.set(this,o,{value:T.event.trigger(T.extend(a[0],T.Event.prototype),a.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===J.get(e,o)&&T.event.add(e,o,Se)}T.event={global:{},add:function(t,e,n,a,o){var r,i,s,l,u,c,d,p,f,h,m,g=J.get(t);if(g)for(n.handler&&(n=(r=n).handler,o=r.selector),o&&T.find.matchesSelector(ae,o),n.guid||(n.guid=T.guid++),(l=g.events)||(l=g.events={}),(i=g.handle)||(i=g.handle=function(e){return void 0!==T&&T.event.triggered!==e.type?T.event.dispatch.apply(t,arguments):void 0}),u=(e=(e||"").match(j)||[""]).length;u--;)f=m=(s=ke.exec(e[u])||[])[1],h=(s[2]||"").split(".").sort(),f&&(d=T.event.special[f]||{},f=(o?d.delegateType:d.bindType)||f,d=T.event.special[f]||{},c=T.extend({type:f,origType:m,data:a,handler:n,guid:n.guid,selector:o,needsContext:o&&T.expr.match.needsContext.test(o),namespace:h.join(".")},r),(p=l[f])||((p=l[f]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(t,a,h,i)||t.addEventListener&&t.addEventListener(f,i)),d.add&&(d.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),o?p.splice(p.delegateCount++,0,c):p.push(c),T.event.global[f]=!0)},remove:function(e,t,n,a,o){var r,i,s,l,u,c,d,p,f,h,m,g=J.hasData(e)&&J.get(e);if(g&&(l=g.events)){for(u=(t=(t||"").match(j)||[""]).length;u--;)if(f=m=(s=ke.exec(t[u])||[])[1],h=(s[2]||"").split(".").sort(),f){for(d=T.event.special[f]||{},p=l[f=(a?d.delegateType:d.bindType)||f]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=r=p.length;r--;)c=p[r],!o&&m!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||a&&a!==c.selector&&("**"!==a||!c.selector)||(p.splice(r,1),c.selector&&p.delegateCount--,d.remove&&d.remove.call(e,c));i&&!p.length&&(d.teardown&&!1!==d.teardown.call(e,h,g.handle)||T.removeEvent(e,f,g.handle),delete l[f])}else for(f in l)T.event.remove(e,f+t[u],n,a,!0);T.isEmptyObject(l)&&J.remove(e,"handle events")}},dispatch:function(e){var t,n,a,o,r,i,s=T.event.fix(e),l=new Array(arguments.length),u=(J.get(this,"events")||{})[s.type]||[],c=T.event.special[s.type]||{};for(l[0]=s,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,De=/\s*$/g;function Ye(e,t){return x(e,"table")&&x(11!==t.nodeType?t:t.firstChild,"tr")&&T(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function je(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Ie(e,t){var n,a,o,r,i,s,l,u;if(1===t.nodeType){if(J.hasData(e)&&(r=J.access(e),i=J.set(t,r),u=r.events))for(o in delete i.handle,i.events={},u)for(n=0,a=u[o].length;n")},clone:function(e,t,n){var a,o,r,i,s,l,u,c=e.cloneNode(!0),d=oe(e);if(!(_.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||T.isXMLDoc(e)))for(i=me(c),a=0,o=(r=me(e)).length;a").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",o=function(e){a.remove(),o=null,e&&t("error"===e.type?404:200,e.type)}),S.head.appendChild(a[0])},abort:function(){o&&o()}}});var tn,nn=[],an=/(=)\?(?=&|$)|\?\?/;T.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=nn.pop()||T.expando+"_"+Yt++;return this[e]=!0,e}}),T.ajaxPrefilter("json jsonp",function(e,t,n){var a,o,r,i=!1!==e.jsonp&&(an.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&an.test(e.data)&&"data");if(i||"jsonp"===e.dataTypes[0])return a=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,i?e[i]=e[i].replace(an,"$1"+a):!1!==e.jsonp&&(e.url+=(Pt.test(e.url)?"&":"?")+e.jsonp+"="+a),e.converters["script json"]=function(){return r||T.error(a+" was not called"),r[0]},e.dataTypes[0]="json",o=k[a],k[a]=function(){r=arguments},n.always(function(){void 0===o?T(k).removeProp(a):k[a]=o,e[a]&&(e.jsonpCallback=t.jsonpCallback,nn.push(a)),r&&v(o)&&o(r[0]),r=o=void 0}),"script"}),_.createHTMLDocument=((tn=S.implementation.createHTMLDocument("").body).innerHTML="
",2===tn.childNodes.length),T.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(_.createHTMLDocument?((a=(t=S.implementation.createHTMLDocument("")).createElement("base")).href=S.location.href,t.head.appendChild(a)):t=S),r=!n&&[],(o=E.exec(e))?[t.createElement(o[1])]:(o=be([e],t,r),r&&r.length&&T(r).remove(),T.merge([],o.childNodes)));var a,o,r},T.fn.load=function(e,t,n){var a,o,r,i=this,s=e.indexOf(" ");return-1").append(T.parseHTML(e)).find(a):e)}).always(n&&function(e,t){i.each(function(){n.apply(this,r||[e.responseText,t,e])})}),this},T.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){T.fn[t]=function(e){return this.on(t,e)}}),T.expr.pseudos.animated=function(t){return T.grep(T.timers,function(e){return t===e.elem}).length},T.offset={setOffset:function(e,t,n){var a,o,r,i,s,l,u=T.css(e,"position"),c=T(e),d={};"static"===u&&(e.style.position="relative"),s=c.offset(),r=T.css(e,"top"),l=T.css(e,"left"),o=("absolute"===u||"fixed"===u)&&-1<(r+l).indexOf("auto")?(i=(a=c.position()).top,a.left):(i=parseFloat(r)||0,parseFloat(l)||0),v(t)&&(t=t.call(e,n,T.extend({},s))),null!=t.top&&(d.top=t.top-s.top+i),null!=t.left&&(d.left=t.left-s.left+o),"using"in t?t.using.call(e,d):c.css(d)}},T.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){T.offset.setOffset(this,t,e)});var e,n,a=this[0];return a?a.getClientRects().length?(e=a.getBoundingClientRect(),n=a.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,a=this[0],o={top:0,left:0};if("fixed"===T.css(a,"position"))t=a.getBoundingClientRect();else{for(t=this.offset(),n=a.ownerDocument,e=a.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===T.css(e,"position");)e=e.parentNode;e&&e!==a&&1===e.nodeType&&((o=T(e).offset()).top+=T.css(e,"borderTopWidth",!0),o.left+=T.css(e,"borderLeftWidth",!0))}return{top:t.top-o.top-T.css(a,"marginTop",!0),left:t.left-o.left-T.css(a,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===T.css(e,"position");)e=e.offsetParent;return e||ae})}}),T.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,o){var r="pageYOffset"===o;T.fn[t]=function(e){return W(this,function(e,t,n){var a;if(m(e)?a=e:9===e.nodeType&&(a=e.defaultView),void 0===n)return a?a[o]:e[t];a?a.scrollTo(r?a.pageXOffset:n,r?n:a.pageYOffset):e[t]=n},t,e,arguments.length)}}),T.each(["top","left"],function(e,n){T.cssHooks[n]=Xe(_.pixelPosition,function(e,t){if(t)return t=Qe(e,n),Ke.test(t)?T(e).position()[n]+"px":t})}),T.each({Height:"height",Width:"width"},function(i,s){T.each({padding:"inner"+i,content:s,"":"outer"+i},function(a,r){T.fn[r]=function(e,t){var n=arguments.length&&(a||"boolean"!=typeof e),o=a||(!0===e||!0===t?"margin":"border");return W(this,function(e,t,n){var a;return m(e)?0===r.indexOf("outer")?e["inner"+i]:e.document.documentElement["client"+i]:9===e.nodeType?(a=e.documentElement,Math.max(e.body["scroll"+i],a["scroll"+i],e.body["offset"+i],a["offset"+i],a["client"+i])):void 0===n?T.css(e,t,o):T.style(e,t,n,o)},s,n?e:void 0,n)}})}),T.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){T.fn[n]=function(e,t){return 0, or explicitly pass "'+h+'" as a prop to "'+o+'".'),n.initSelector(),n.initSubscription(),n}w(e,a);var t=e.prototype;return t.getChildContext=function(){var e,t=this.propsMode?null:this.subscription;return(e={})[_]=t||this.context[_],e},t.componentDidMount=function(){p&&(this.subscription.trySubscribe(),this.selector.run(this.props),this.selector.shouldComponentUpdate&&this.forceUpdate())},t.componentWillReceiveProps=function(e){this.selector.run(e)},t.shouldComponentUpdate=function(){return this.selector.shouldComponentUpdate},t.componentWillUnmount=function(){this.subscription&&this.subscription.tryUnsubscribe(),this.subscription=null,this.notifyNestedSubs=j,this.store=null,this.selector.run=j,this.selector.shouldComponentUpdate=!1},t.getWrappedInstance=function(){return D()(g,"To access the wrapped instance, you need to specify { withRef: true } in the options argument of the "+l+"() call."),this.wrappedInstance},t.setWrappedInstance=function(e){this.wrappedInstance=e},t.initSelector=function(){var e=i(this.store.dispatch,r);this.selector=function(n,a){var o={run:function(e){try{var t=n(a.getState(),e);t===o.props&&!o.error||(o.shouldComponentUpdate=!0,o.props=t,o.error=null)}catch(e){o.shouldComponentUpdate=!0,o.error=e}}};return o}(e,this.store),this.selector.run(this.props)},t.initSubscription=function(){if(p){var e=(this.propsMode?this.props:this.context)[_];this.subscription=new O(this.store,e,this.onStateChange.bind(this)),this.notifyNestedSubs=this.subscription.notifyNestedSubs.bind(this.subscription)}},t.onStateChange=function(){this.selector.run(this.props),this.selector.shouldComponentUpdate?(this.componentDidUpdate=this.notifyNestedSubsOnComponentDidUpdate,this.setState(P)):this.notifyNestedSubs()},t.notifyNestedSubsOnComponentDidUpdate=function(){this.componentDidUpdate=void 0,this.notifyNestedSubs()},t.isSubscribed=function(){return Boolean(this.subscription)&&this.subscription.isSubscribed()},t.addExtraProps=function(e){if(!(g||c||this.propsMode&&this.subscription))return e;var t=Object(x.a)({},e);return g&&(t.ref=this.setWrappedInstance),c&&(t[c]=this.renderCount++),this.propsMode&&this.subscription&&(t[_]=this.subscription),t},t.render=function(){var e=this.selector;if(e.shouldComponentUpdate=!1,e.error)throw e.error;return Object(k.createElement)(n,this.addExtraProps(e.props))},e}(k.Component);return t.WrappedComponent=n,t.displayName=o,t.childContextTypes=M,t.contextTypes=b,t.propTypes=b,L()(t,n)}}var c=Object.prototype.hasOwnProperty;function d(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function v(e,t){if(d(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(var o=0;othis.menuNode.clientHeight)){var e=this.menuNode.clientHeight+this.menuNode.scrollTop,t=this.itemNode.offsetTop+this.itemNode.offsetHeight;e"===(c=e.charAt(r+1))){o+="(",r++,0[0-9][0-9][0-9][0-9])-(?[0-9][0-9]?)-(?[0-9][0-9]?)(?:(?:[Tt]|[ \t]+)(?[0-9][0-9]?):(?[0-9][0-9]):(?[0-9][0-9])(?:.(?[0-9]*))?(?:[ \t]*(?Z|(?[-+])(?[0-9][0-9]?)(?::(?[0-9][0-9]))?))?)?$","i"),r.LOCAL_TIMEZONE_OFFSET=60*(new Date).getTimezoneOffset()*1e3,r.trim=function(e,t){var n,a;return null==t&&(t="\\s"),null==(n=this.REGEX_LEFT_TRIM_BY_CHAR[t])&&(this.REGEX_LEFT_TRIM_BY_CHAR[t]=n=new RegExp("^"+t+t+"*")),n.lastIndex=0,null==(a=this.REGEX_RIGHT_TRIM_BY_CHAR[t])&&(this.REGEX_RIGHT_TRIM_BY_CHAR[t]=a=new RegExp(t+""+t+"*$")),a.lastIndex=0,e.replace(n,"").replace(a,"")},r.ltrim=function(e,t){var n;return null==t&&(t="\\s"),null==(n=this.REGEX_LEFT_TRIM_BY_CHAR[t])&&(this.REGEX_LEFT_TRIM_BY_CHAR[t]=n=new RegExp("^"+t+t+"*")),n.lastIndex=0,e.replace(n,"")},r.rtrim=function(e,t){var n;return null==t&&(t="\\s"),null==(n=this.REGEX_RIGHT_TRIM_BY_CHAR[t])&&(this.REGEX_RIGHT_TRIM_BY_CHAR[t]=n=new RegExp(t+""+t+"*$")),n.lastIndex=0,e.replace(n,"")},r.isEmpty=function(e){return!e||""===e||"0"===e||e instanceof Array&&0===e.length||this.isEmptyObject(e)},r.isEmptyObject=function(t){var n;return t instanceof Object&&0===function(){var e;for(n in e=[],t)o.call(t,n)&&e.push(n);return e}().length},r.subStrCount=function(e,t,n,a){var o,r,i,s,l,u;for(o=0,e=""+e,t=""+t,null!=n&&(e=e.slice(n)),null!=a&&(e=e.slice(0,a)),s=e.length,u=t.length,r=i=0,l=s;0<=l?i>6)+t(128|63&e):e<65536?t(224|e>>12)+t(128|e>>6&63)+t(128|63&e):t(240|e>>18)+t(128|e>>12&63)+t(128|e>>6&63)+t(128|63&e)},r.parseBoolean=function(e,t){var n;return null==t&&(t=!0),"string"==typeof e?(n=e.toLowerCase(),!(!t&&"no"===n)&&"0"!==n&&"false"!==n&&""!==n):!!e},r.isNumeric=function(e){return this.REGEX_SPACES.lastIndex=0,"number"==typeof e||"string"==typeof e&&!isNaN(e)&&""!==e.replace(this.REGEX_SPACES,"")},r.stringToDate=function(e){var t,n,a,o,r,i,s,l,u,c;if(!(null!=e?e.length:void 0))return null;if(!(r=this.PATTERN_DATE.exec(e)))return null;if(c=parseInt(r.year,10),s=parseInt(r.month,10)-1,n=parseInt(r.day,10),null==r.hour)return t=new Date(Date.UTC(c,s,n));if(o=parseInt(r.hour,10),i=parseInt(r.minute,10),l=parseInt(r.second,10),null!=r.fraction){for(a=r.fraction.slice(0,3);a.length<3;)a+="0";a=parseInt(a,10)}else a=0;return null!=r.tz&&(u=6e4*(60*parseInt(r.tz_hour,10)+(null!=r.tz_minute?parseInt(r.tz_minute,10):0)),"-"===r.tz_sign&&(u*=-1)),t=new Date(Date.UTC(c,s,n,o,i,l,a)),u&&t.setTime(t.getTime()-u),t},r.strRepeat=function(e,t){var n,a;for(a="",n=0;n or withRouter() outside a ");var l=t.route,u=(a||l.location).pathname;return Object(p.a)(u,{path:o,strict:r,exact:i,sensitive:s},l.match)},y.prototype.componentWillMount=function(){o()(!(this.props.component&&this.props.render),"You should not use and in the same route; will be ignored"),o()(!(this.props.component&&this.props.children&&!h(this.props.children)),"You should not use and in the same route; will be ignored"),o()(!(this.props.render&&this.props.children&&!h(this.props.children)),"You should not use and in the same route; will be ignored")},y.prototype.componentWillReceiveProps=function(e,t){o()(!(e.location&&!this.props.location),' elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'),o()(!(!e.location&&this.props.location),' elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.'),this.setState({match:this.computeMatch(e,t.router)})},y.prototype.render=function(){var e=this.state.match,t=this.props,n=t.children,a=t.component,o=t.render,r=this.context.router,i=r.history,s=r.route,l=r.staticContext,u={match:e,location:this.props.location||s.location,history:i,staticContext:l};return a?e?d.a.createElement(a,u):null:o?e?o(u):null:"function"==typeof n?n(u):n&&!h(n)?d.a.Children.only(n):null},y);function y(){var e,t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,y);for(var n=arguments.length,a=Array(n),o=0;odocument.F=Object<\/script>"),e.close(),c=e.F;n--;)delete c[u][s[n]];return c()};e.exports=Object.create||function(e,t){var n;return null!==e?(o[u]=r(e),n=new o,o[u]=null,n[l]=e):n=c(),void 0===t?n:i(n,t)}},function(e,t,n){var a=n(75).f,o=n(70),r=n(78)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,r)&&a(e,r,{configurable:!0,value:t})}},function(e,t,n){t.f=n(78)},function(e,t,n){var a=n(60),o=n(68),r=n(102),i=n(132),s=n(75).f;e.exports=function(e){var t=o.Symbol||(o.Symbol=r?{}:a.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:i.f(e)})}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(t,e){if(!t)return null;if("string"==typeof t)return document.getElementById(t);"function"==typeof t&&(t=t(e));if(!t)return null;try{return(0,a.findDOMNode)(t)}catch(e){return t}};var a=n(25);e.exports=t.default},function(e,t,n){"use strict";n(67),n(453)},function(e,t,n){"use strict";function l(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}function u(n){this.setState(function(e){var t=this.constructor.getDerivedStateFromProps(n,e);return null!=t?t:null}.bind(this))}function c(e,t){try{var n=this.props,a=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,a)}finally{this.props=n,this.state=a}}function a(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if("function"!=typeof e.getDerivedStateFromProps&&"function"!=typeof t.getSnapshotBeforeUpdate)return e;var n=null,a=null,o=null;if("function"==typeof t.componentWillMount?n="componentWillMount":"function"==typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"==typeof t.componentWillReceiveProps?a="componentWillReceiveProps":"function"==typeof t.UNSAFE_componentWillReceiveProps&&(a="UNSAFE_componentWillReceiveProps"),"function"==typeof t.componentWillUpdate?o="componentWillUpdate":"function"==typeof t.UNSAFE_componentWillUpdate&&(o="UNSAFE_componentWillUpdate"),null!==n||null!==a||null!==o){var r=e.displayName||e.name,i="function"==typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+r+" uses "+i+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==a?"\n "+a:"")+(null!==o?"\n "+o:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"==typeof e.getDerivedStateFromProps&&(t.componentWillMount=l,t.componentWillReceiveProps=u),"function"==typeof t.getSnapshotBeforeUpdate){if("function"!=typeof t.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=c;var s=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var a=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;s.call(this,e,t,a)}}return e}n.r(t),n.d(t,"polyfill",function(){return a}),c.__suppressDeprecationWarning=u.__suppressDeprecationWarning=l.__suppressDeprecationWarning=!0},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var a,o,h=d(n(5)),r=d(n(4)),i=d(n(6)),s=d(n(7)),l=n(0),m=d(l),u=d(n(2)),g=d(n(12)),y=d(n(23)),c=n(11),_=d(n(93));function d(e){return e&&e.__esModule?e:{default:e}}var p,f=c.func.bindCtx,v=c.obj.pickOthers,b=(p=l.Component,(0,s.default)(M,p),M.prototype.getSelected=function(){var e=this.props,t=e._key,n=e.root,a=e.selected,o=n.props.selectMode,r=n.state.selectedKeys;return a||!!o&&-1=d,T=(0,P.default)(((t={})[o+"upload-inner"]=!0,t[o+"hidden"]=S,t)),C=this.props.children;if("card"===i){var x,E=(0,P.default)(((x={})[o+"upload-card"]=!0,x[o+"disabled"]=c,x));C=Y.default.createElement("div",{className:E},Y.default.createElement(I.default,{type:"add",size:"large"}),Y.default.createElement("div",{tabIndex:"0",role:"button",className:o+"upload-text"},C))}var L=c?j.func.prevent:m,D=j.obj.pickAttrsWith(this.props,"data-");return Y.default.createElement("div",(0,N.default)({className:k,style:l},D),Y.default.createElement(A.default,(0,N.default)({},w,{beforeUpload:f,dragable:r,disabled:c||S,className:T,onSelect:this.onSelect,onDrop:this.onDrop,onProgress:this.onProgress,onSuccess:this.onSuccess,onError:this.onError,ref:this.saveUploaderRef}),C),a||_?Y.default.createElement(R.default,{useDataURL:u,uploader:this,listType:a,value:this.state.value,closable:p,onRemove:L,progressProps:b,onCancel:g,onPreview:y,extraRender:v,rtl:M}):null)},o=a=y,a.displayName="Upload",a.propTypes=(0,N.default)({},d.default.propTypes,R.default.propTypes,{prefix:u.default.string.isRequired,action:u.default.string,value:u.default.array,defaultValue:u.default.array,shape:u.default.oneOf(["card"]),listType:u.default.oneOf(["text","image","card"]),list:u.default.any,name:u.default.string,data:u.default.oneOfType([u.default.object,u.default.func]),formatter:u.default.func,limit:u.default.number,timeout:u.default.number,dragable:u.default.bool,closable:u.default.bool,useDataURL:u.default.bool,disabled:u.default.bool,onSelect:u.default.func,onProgress:u.default.func,onChange:u.default.func,onSuccess:u.default.func,afterSelect:u.default.func,onRemove:u.default.func,onError:u.default.func,beforeUpload:u.default.func,onDrop:u.default.func,className:u.default.string,style:u.default.object,children:u.default.node,autoUpload:u.default.bool,request:u.default.func,progressProps:u.default.object,rtl:u.default.bool}),a.defaultProps=(0,N.default)({},d.default.defaultProps,{prefix:"next-",limit:1/0,autoUpload:!0,closable:!0,onSelect:m,onProgress:m,onChange:m,onSuccess:m,onRemove:m,onError:m,onDrop:m,beforeUpload:m,afterSelect:m}),r=function(){var p=this;this.onSelect=function(e){var t=p.props,n=t.autoUpload,a=t.afterSelect,o=t.onSelect,r=t.limit,i=p.state.value.length+e.length,s=r-p.state.value.length;if(!(s<=0)){var l=e.map(function(e){var t=(0,f.fileToObject)(e);return t.state="selected",t}),u=l,c=[];ro;)i(a,n=t[o++])&&(~l(r,n)||r.push(n));return r}},function(e,t,n){var a=n(159);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==a(e)?e.split(""):Object(e)}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){"use strict";function v(){return this}var b=n(102),M=n(89),w=n(161),k=n(74),S=n(129),T=n(404),C=n(131),x=n(407),E=n(78)("iterator"),L=!([].keys&&"next"in[].keys()),D="values";e.exports=function(e,t,n,a,o,r,i){T(n,t,a);function s(e){if(!L&&e in h)return h[e];switch(e){case"keys":case D:return function(){return new n(this,e)}}return function(){return new n(this,e)}}var l,u,c,d=t+" Iterator",p=o==D,f=!1,h=e.prototype,m=h[E]||h["@@iterator"]||o&&h[o],g=m||s(o),y=o?p?s("entries"):g:void 0,_="Array"==t&&h.entries||m;if(_&&(c=x(_.call(new e)))!==Object.prototype&&c.next&&(C(c,d,!0),b||"function"==typeof c[E]||k(c,E,v)),p&&m&&m.name!==D&&(f=!0,g=function(){return m.call(this)}),b&&!i||!L&&!f&&h[E]||k(h,E,g),S[t]=g,S[d]=v,o)if(l={values:p?g:s(D),keys:r?g:s("keys"),entries:y},i)for(u in l)u in h||w(h,u,l[u]);else M(M.P+M.F*(L||f),t,l);return l}},function(e,t,n){e.exports=n(74)},function(e,t,n){var a=n(157),o=n(126).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return a(e,o)}},function(e,t,n){var a=n(104),o=n(100),r=n(77),i=n(121),s=n(70),l=n(155),u=Object.getOwnPropertyDescriptor;t.f=n(69)?u:function(e,t){if(e=r(e),t=i(t,!0),l)try{return u(e,t)}catch(e){}if(s(e,t))return o(!a.f.call(e,t),e[t])}},function(e,t,n){"use strict"; /* object-assign (c) Sindre Sorhus @license MIT -*/var l=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var a={};return"abcdefghijklmnopqrst".split("").forEach(function(e){a[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},a)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,o=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),r=1;re.clientHeight&&0a.length&&a.every(function(e,t){return e===n[t]})},k.prototype.handleOpen=function(t,e,n,a){var o=this,r=void 0,i=this.props,s=i.mode,l=i.openMode,u=this.state.openKeys,c=u.indexOf(t);e&&-1===c?"inline"===s?"single"===l?(r=u.filter(function(e){return!o.isSibling(o.k2n[t].pos,o.k2n[e].pos)})).push(t):r=u.concat(t):(r=u.filter(function(e){return o.isAncestor(o.k2n[t].pos,o.k2n[e].pos)})).push(t):!e&&-1this.popupNode.offsetWidth&&y(this.popupNode,"width",f.offsetWidth+"px")}"outside"!==u||"hoz"===l&&1===n||(y(this.popupNode,"height",p.offsetHeight+"px"),y(this.popupNode,"overflow-y","scroll"));var h=this.popupProps;h.onOpen&&h.onOpen()},P.prototype.handlePopupClose=function(){var e=this.props.root.popupNodes,t=e.indexOf(this.popupNode);-1 "+this.message+" (line "+this.parsedLine+": '"+this.snippet+"')":" "+this.message},n=a,e.exports=n},function(e,t){var n,o={}.hasOwnProperty;function a(e,t,n){this.message=e,this.parsedLine=t,this.snippet=n}(function(e,t){for(var n in t)o.call(t,n)&&(e[n]=t[n]);function a(){this.constructor=e}a.prototype=t.prototype,e.prototype=new a,e.__super__=t.prototype})(a,Error),a.prototype.toString=function(){return null!=this.parsedLine&&null!=this.snippet?" "+this.message+" (line "+this.parsedLine+": '"+this.snippet+"')":" "+this.message},n=a,e.exports=n},function(e,t,n){"use strict";t.__esModule=!0,t.triggerEvents=void 0,t.getOffsetWH=function(e,t){var n="width";"left"!==t&&"right"!==t||(n="height");return e?e.getBoundingClientRect()[n]:0},t.getOffsetLT=function(e,t){var n="left";"left"!==t&&"right"!==t||(n="top");return e.getBoundingClientRect()[n]},t.isTransformSupported=function(e){return"transform"in e||"webkitTransform"in e||"MozTransform"in e},t.toArray=function(e){var n=[];return r.default.Children.forEach(e,function(e,t){r.default.isValidElement(e)&&n.push(r.default.cloneElement(e,{key:e.key||t}))}),n};var a,o=n(0),r=(a=o)&&a.__esModule?a:{default:a};t.triggerEvents={CLICK:"click",HOVER:"hover"}},function(e,t,n){"use strict";t.__esModule=!0;var a,o=n(13),i=(a=o)&&a.__esModule?a:{default:a};t.default=function(e,t){var n=e.listType,a=e.defaultFileList,o=e.fileList,r=(0,i.default)(e,["listType","defaultFileList","fileList"]);return"text-image"===n?(t("listType=text-image","listType=image","Upload"),r.listType="image"):"picture-card"===n?(t("listType=picture-card","listType=card","Upload"),r.listType="card"):r.listType=n,"defaultFileList"in e&&(t("defaultFileList","defaultValue","Upload"),r.defaultValue=a),"fileList"in e&&(t("fileList","value","Upload"),r.value=o),r},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var i=r(n(4)),s=r(n(6)),a=r(n(7)),o=n(0);function r(e){return e&&e.__esModule?e:{default:e}}var l,u=(l=o.Component,(0,a.default)(c,l),c.prototype.abort=function(e){this.uploaderRef.abort(e)},c.prototype.startUpload=function(){this.uploaderRef.startUpload()},c.prototype.isUploading=function(){return this.uploaderRef.isUploading()},c);function c(){var e,t,n;(0,i.default)(this,c);for(var a=arguments.length,o=Array(a),r=0;re.slidesToShow&&(t=e.slideWidth*e.slidesToShow*-1,o=e.slideHeight*e.slidesToShow*-1),e.slideCount%e.slidesToScroll!=0){var r=e.slideIndex+e.slidesToScroll>e.slideCount&&e.slideCount>e.slidesToShow;if(e.rtl)r=(e.slideIndex>=e.slideCount?e.slideCount-e.slideIndex:e.slideIndex)+e.slidesToScroll>e.slideCount&&e.slideCount>e.slidesToShow;r&&(o=e.slideIndex>e.slideCount?(t=(e.slidesToShow-(e.slideIndex-e.slideCount))*e.slideWidth*-1,(e.slidesToShow-(e.slideIndex-e.slideCount))*e.slideHeight*-1):(t=e.slideCount%e.slidesToScroll*e.slideWidth*-1,e.slideCount%e.slidesToScroll*e.slideHeight*-1))}}else e.slideCount%e.slidesToScroll!=0&&e.slideIndex+e.slidesToScroll>e.slideCount&&e.slideCount>e.slidesToShow&&(t=(e.slidesToShow-e.slideCount%e.slidesToScroll)*e.slideWidth);if(e.centerMode&&(e.infinite?t+=e.slideWidth*Math.floor(e.slidesToShow/2):t=e.slideWidth*Math.floor(e.slidesToShow/2)),n=e.vertical?e.slideIndex*e.slideHeight*-1+o:e.slideIndex*e.slideWidth*-1+t,!0===e.variableWidth){var i=void 0;n=(a=e.slideCount<=e.slidesToShow||!1===e.infinite?s.default.findDOMNode(e.trackRef).childNodes[e.slideIndex]:(i=e.slideIndex+e.slidesToShow,s.default.findDOMNode(e.trackRef).childNodes[i]))?-1*a.offsetLeft:0,!0===e.centerMode&&(a=!1===e.infinite?s.default.findDOMNode(e.trackRef).children[e.slideIndex]:s.default.findDOMNode(e.trackRef).children[e.slideIndex+e.slidesToShow+1])&&(n=-1*a.offsetLeft+(e.listWidth-a.offsetWidth)/2)}return n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.routerMiddleware=t.routerActions=t.goForward=t.goBack=t.go=t.replace=t.push=t.CALL_HISTORY_METHOD=t.routerReducer=t.LOCATION_CHANGE=t.syncHistoryWithStore=void 0;var a=n(303);Object.defineProperty(t,"LOCATION_CHANGE",{enumerable:!0,get:function(){return a.LOCATION_CHANGE}}),Object.defineProperty(t,"routerReducer",{enumerable:!0,get:function(){return a.routerReducer}});var o=n(304);Object.defineProperty(t,"CALL_HISTORY_METHOD",{enumerable:!0,get:function(){return o.CALL_HISTORY_METHOD}}),Object.defineProperty(t,"push",{enumerable:!0,get:function(){return o.push}}),Object.defineProperty(t,"replace",{enumerable:!0,get:function(){return o.replace}}),Object.defineProperty(t,"go",{enumerable:!0,get:function(){return o.go}}),Object.defineProperty(t,"goBack",{enumerable:!0,get:function(){return o.goBack}}),Object.defineProperty(t,"goForward",{enumerable:!0,get:function(){return o.goForward}}),Object.defineProperty(t,"routerActions",{enumerable:!0,get:function(){return o.routerActions}});var r=s(n(449)),i=s(n(450));function s(e){return e&&e.__esModule?e:{default:e}}t.syncHistoryWithStore=r.default,t.routerMiddleware=i.default},function(e,t,n){"use strict";function a(o){return function(e){var n=e.dispatch,a=e.getState;return function(t){return function(e){return"function"==typeof e?e(n,a,o):t(e)}}}}var o=a();o.withExtraArgument=a,t.a=o},function(e,t,n){"use strict";var a=n(150),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},d={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},i={};function p(e){return a.isMemo(e)?r:i[e.$$typeof]||o}i[a.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var f=Object.defineProperty,h=Object.getOwnPropertyNames,m=Object.getOwnPropertySymbols,g=Object.getOwnPropertyDescriptor,y=Object.getPrototypeOf,_=Object.prototype;e.exports=function e(t,n,a){if("string"==typeof n)return t;if(_){var o=y(n);o&&o!==_&&e(t,o,a)}var r=h(n);m&&(r=r.concat(m(n)));for(var i=p(t),s=p(n),l=0;l\n com.alibaba.nacos\n nacos-client\n ${version}\n
\n*/\npackage com.alibaba.nacos.example;\n\nimport java.util.Properties;\nimport java.util.concurrent.Executor;\nimport com.alibaba.nacos.api.NacosFactory;\nimport com.alibaba.nacos.api.config.ConfigService;\nimport com.alibaba.nacos.api.config.listener.Listener;\nimport com.alibaba.nacos.api.exception.NacosException;\n\n/**\n * Config service example\n * \n * @author Nacos\n *\n */\npublic class ConfigExample {\n\n\tpublic static void main(String[] args) throws NacosException, InterruptedException {\n\t\tString serverAddr = "localhost";\n\t\tString dataId = "'.concat(e.dataId,'";\n\t\tString group = "').concat(e.group,'";\n\t\tProperties properties = new Properties();\n\t\tproperties.put(PropertyKeyConst.SERVER_ADDR, serverAddr);\n\t\tConfigService configService = NacosFactory.createConfigService(properties);\n\t\tString content = configService.getConfig(dataId, group, 5000);\n\t\tSystem.out.println(content);\n\t\tconfigService.addListener(dataId, group, new Listener() {\n\t\t\t@Override\n\t\t\tpublic void receiveConfigInfo(String configInfo) {\n\t\t\t\tSystem.out.println("recieve:" + configInfo);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic Executor getExecutor() {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t});\n\t\t\n\t\tboolean isPublishOk = configService.publishConfig(dataId, group, "content");\n\t\tSystem.out.println(isPublishOk);\n\t\t\n\t\tThread.sleep(3000);\n\t\tcontent = configService.getConfig(dataId, group, 5000);\n\t\tSystem.out.println(content);\n\n\t\tboolean isRemoveOk = configService.removeConfig(dataId, group);\n\t\tSystem.out.println(isRemoveOk);\n\t\tThread.sleep(3000);\n\n\t\tcontent = configService.getConfig(dataId, group, 5000);\n\t\tSystem.out.println(content);\n\t\tThread.sleep(300000);\n\n\t}\n}\n')}},{key:"getNodejsCode",value:function(e){return"TODO"}},{key:"getCppCode",value:function(e){return"TODO"}},{key:"getShellCode",value:function(e){return"TODO"}},{key:"getPythonCode",value:function(e){return"TODO"}},{key:"openDialog",value:function(e){var t=this;this.setState({dialogvisible:!0}),this.record=e,setTimeout(function(){t.getData()})}},{key:"closeDialog",value:function(){this.setState({dialogvisible:!1})}},{key:"createCodeMirror",value:function(e,t){var n=this.refs.codepreview;n&&(n.innerHTML="",this.cm=window.CodeMirror(n,{value:t,mode:e,height:400,width:500,lineNumbers:!0,theme:"xq-light",lint:!0,tabMode:"indent",autoMatchParens:!0,textWrapping:!0,gutters:["CodeMirror-lint-markers"],extraKeys:{F1:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)}}}))}},{key:"changeTab",value:function(e,t){var n=this;setTimeout(function(){n[e]=!0,n.createCodeMirror("text/javascript",t)})}},{key:"render",value:function(){var e=this.props.locale,t=void 0===e?{}:e,n=oe.a.createElement("div",null);return oe.a.createElement("div",null,oe.a.createElement(W.a,{title:t.sampleCode,style:{width:"80%"},visible:this.state.dialogvisible,footer:n,onClose:this.closeDialog.bind(this)},oe.a.createElement("div",{style:{height:500}},oe.a.createElement(g.a,{tip:t.loading,style:{width:"100%"},visible:this.state.loading},oe.a.createElement(de.a,{shape:"text",style:{height:40,paddingBottom:10}},oe.a.createElement(pe,{title:"Java",key:1,onClick:this.changeTab.bind(this,"commoneditor1",this.defaultCode)}),oe.a.createElement(pe,{title:"Spring Boot",key:2,onClick:this.changeTab.bind(this,"commoneditor2",this.sprigboot_code)}),oe.a.createElement(pe,{title:"Spring Cloud",key:21,onClick:this.changeTab.bind(this,"commoneditor21",this.sprigcloud_code)}),oe.a.createElement(pe,{title:"Node.js",key:3,onClick:this.changeTab.bind(this,"commoneditor3",this.nodejsCode)}),oe.a.createElement(pe,{title:"C++",key:4,onClick:this.changeTab.bind(this,"commoneditor4",this.cppCode)}),oe.a.createElement(pe,{title:"Shell",key:5,onClick:this.changeTab.bind(this,"commoneditor5",this.shellCode)}),oe.a.createElement(pe,{title:"Python",key:6,onClick:this.changeTab.bind(this,"commoneditor6",this.pythonCode)})),oe.a.createElement("div",{ref:"codepreview"})))))}}]),n}(oe.a.Component),o.displayName="ShowCodeing",a=r))||a,he=(n(629),ee.a.Row),me=ee.a.Col,ge=(0,X.a.config)((l=s=function(e){function n(e){var t;return Object(U.a)(this,n),(t=Object(q.a)(this,Object(G.a)(n).call(this,e))).state={visible:!1,title:"",content:"",isok:!0,dataId:"",group:""},t}return Object($.a)(n,e),Object(K.a)(n,[{key:"componentDidMount",value:function(){this.initData()}},{key:"initData",value:function(){var e=this.props.locale,t=void 0===e?{}:e;this.setState({title:t.confManagement})}},{key:"openDialog",value:function(e){this.setState({visible:!0,title:e.title,content:e.content,isok:e.isok,dataId:e.dataId,group:e.group,message:e.message})}},{key:"closeDialog",value:function(){this.setState({visible:!1})}},{key:"render",value:function(){var e=this.props.locale,t=void 0===e?{}:e,n=oe.a.createElement("div",{style:{textAlign:"right"}},oe.a.createElement(C.a,{type:"primary",onClick:this.closeDialog.bind(this)},t.determine));return oe.a.createElement("div",null,oe.a.createElement(W.a,{visible:this.state.visible,footer:n,style:{width:555},onCancel:this.closeDialog.bind(this),onClose:this.closeDialog.bind(this),title:t.deletetitle},oe.a.createElement("div",null,oe.a.createElement(he,null,oe.a.createElement(me,{span:"4",style:{paddingTop:16}},oe.a.createElement(R.a,{type:"".concat(this.state.isok?"success":"delete","-filling"),style:{color:this.state.isok?"green":"red"},size:"xl"})),oe.a.createElement(me,{span:"20"},oe.a.createElement("div",null,oe.a.createElement("h3",null,this.state.isok?t.deletedSuccessfully:t.deleteFailed),oe.a.createElement("p",null,oe.a.createElement("span",{style:{color:"#999",marginRight:5}},"Data ID:"),oe.a.createElement("span",{style:{color:"#c7254e"}},this.state.dataId)),oe.a.createElement("p",null,oe.a.createElement("span",{style:{color:"#999",marginRight:5}},"Group:"),oe.a.createElement("span",{style:{color:"#c7254e"}},this.state.group)),this.state.isok?"":oe.a.createElement("p",{style:{color:"red"}},this.state.message)))))))}}]),n}(oe.a.Component),s.displayName="DeleteDialog",i=l))||i,ye=(n(630),n(365)),_e=n.n(ye),ve=(0,X.a.config)((d=c=function(e){function t(){return Object(U.a)(this,t),Object(q.a)(this,Object(G.a)(t).apply(this,arguments))}return Object($.a)(t,e),Object(K.a)(t,[{key:"render",value:function(){var e=this.props,t=e.data,n=void 0===t?{}:t,a=e.height,o=e.locale,r=void 0===o?{}:o;return oe.a.createElement("div",null,"notice"===n.modeType?oe.a.createElement("div",{"data-spm-click":"gostr=/aliyun;locaid=notice"},oe.a.createElement(_e.a,{style:{marginBottom:1l?I.a.createElement($.a,{className:"pagination",total:s.count,pageSize:l,onChange:function(e){return a.onChangePage(e)}}):null,I.a.createElement(Z,{ref:this.editInstanceDialog,serviceName:r,clusterName:n,openLoading:function(){return a.openLoading()},closeLoading:function(){return a.closeLoading()},getInstanceList:function(){return a.getInstanceList()}})):null}}]),n}(I.a.Component),d.displayName="InstanceTable",c=p))||c,te=n(66),ne=(n(643),P.a.Item),ae={labelCol:{fixedSpan:10},wrapperCol:{span:14}},oe=(0,O.a.config)((m=h=function(e){function n(e){var t;return Object(C.a)(this,n),(t=Object(E.a)(this,Object(L.a)(n).call(this,e))).editServiceDialog=I.a.createRef(),t.editClusterDialog=I.a.createRef(),t.state={serviceName:a(e.location.search,"name"),groupName:a(e.location.search,"groupName"),loading:!1,currentPage:1,clusters:[],instances:{},service:{},pageSize:10,pageNum:{}},t}return Object(D.a)(n,e),Object(x.a)(n,[{key:"componentDidMount",value:function(){this.state.serviceName?this.getServiceDetail():this.props.history.goBack()}},{key:"getServiceDetail",value:function(){var r=this,e=this.state,t=e.serviceName,n=e.groupName;Object(A.c)({url:"v1/ns/catalog/service?serviceName=".concat(t,"&groupName=").concat(n),beforeSend:function(){return r.openLoading()},success:function(e){var t=e.clusters,n=void 0===t?[]:t,a=e.service,o=void 0===a?{}:a;return r.setState({service:o,clusters:n})},error:function(e){return T.a.error(e.responseText||"error")},complete:function(){return r.closeLoading()}})}},{key:"openLoading",value:function(){this.setState({loading:!0})}},{key:"closeLoading",value:function(){this.setState({loading:!1})}},{key:"openEditServiceDialog",value:function(){this.editServiceDialog.current.getInstance().show(this.state.service)}},{key:"openClusterDialog",value:function(e){this.editClusterDialog.current.getInstance().show(e)}},{key:"render",value:function(){var t=this,e=this.props.locale,n=void 0===e?{}:e,a=this.state,o=a.serviceName,r=a.groupName,i=a.loading,s=a.service,l=void 0===s?{}:s,u=a.clusters,c=l.metadata,d=void 0===c?{}:c,p=l.selector,f=void 0===p?{}:p,h="";return Object.keys(d).length&&(h=JSON.stringify(d,null,"\t")),I.a.createElement("div",{className:"main-container service-detail"},I.a.createElement(y.a,{shape:"flower",tip:"Loading...",className:"loading",visible:i,color:"#333"},I.a.createElement("h1",{style:{position:"relative",width:"100%"}},n.serviceDetails,I.a.createElement(w.a,{type:"primary",className:"header-btn",onClick:function(){return t.props.history.goBack()}},n.back),I.a.createElement(w.a,{type:"normal",className:"header-btn",onClick:function(){return t.openEditServiceDialog()}},n.editService)),I.a.createElement(P.a,ae,I.a.createElement(ne,{label:"".concat(n.serviceName,":")},I.a.createElement(S.a,{value:l.name,readOnly:!0})),I.a.createElement(ne,{label:"".concat(n.groupName,":")},I.a.createElement(S.a,{value:l.groupName,readOnly:!0})),I.a.createElement(ne,{label:"".concat(n.protectThreshold,":")},I.a.createElement(S.a,{value:l.protectThreshold,readOnly:!0})),I.a.createElement(ne,{label:"".concat(n.metadata,":")},I.a.createElement(q.a,{language:"json",width:"100%",height:200,value:h,options:K.c})),I.a.createElement(ne,{label:"".concat(n.type,":")},I.a.createElement(S.a,{value:f.type,readOnly:!0})),"label"===l.type&&I.a.createElement(ne,{label:"".concat(n.selector,":")},I.a.createElement(S.a,{value:f.selector,readOnly:!0}))),u.map(function(e){return I.a.createElement(v.a,{key:e.name,className:"cluster-card",title:"".concat(n.cluster,":"),subTitle:e.name,contentHeight:"auto",extra:I.a.createElement(w.a,{type:"normal",onClick:function(){return t.openClusterDialog(e)}},n.editCluster)},I.a.createElement(ee,{clusterName:e.name,serviceName:o,groupName:r}))})),I.a.createElement(R.a,{ref:this.editServiceDialog,openLoading:function(){return t.openLoading()},closeLoading:function(){return t.closeLoading()},getServiceDetail:function(){return t.getServiceDetail()}}),I.a.createElement(G,{ref:this.editClusterDialog,openLoading:function(){return t.openLoading()},closeLoading:function(){return t.closeLoading()},getServiceDetail:function(){return t.getServiceDetail()}}))}}]),n}(I.a.Component),h.displayName="ServiceDetail",f=m))||f;t.a=oe},function(e,t,n){"use strict";n(39);var a,o,r,i,s,l,u=n(26),y=n.n(u),c=(n(31),n(19)),_=n.n(c),d=(n(339),n(118)),v=n.n(d),p=(n(33),n(23)),b=n.n(p),f=(n(105),n(71)),M=n.n(f),h=(n(92),n(59)),w=n.n(h),m=(n(62),n(32)),k=n.n(m),g=(n(37),n(8)),S=n.n(g),T=(n(34),n(10)),C=n.n(T),x=(n(111),n(51)),E=n.n(x),L=n(56),D=n(27),N=(n(38),n(21)),O=n.n(N),Y=(n(44),n(24)),P=n.n(Y),j=n(14),I=n(15),A=n(16),R=n(17),H=n(18),F=(n(28),n(9)),z=n.n(F),W=(n(54),n(30)),B=n.n(W),V=n(0),U=n.n(V),K=n(1),q=n(65),G=n(119),J=n(85),$=(n(589),B.a.Row),Q=B.a.Col,X=(0,z.a.config)((r=o=function(e){function n(e){var t;return Object(j.a)(this,n),(t=Object(A.a)(this,Object(R.a)(n).call(this,e))).diffeditor=U.a.createRef(),t.state={dialogvisible:!1},t}return Object(H.a)(n,e),Object(I.a)(n,[{key:"openDialog",value:function(e,t){var n=this;this.setState({dialogvisible:!0}),setTimeout(function(){n.createDiffCodeMirror(e,t)})}},{key:"closeDialog",value:function(){this.setState({dialogvisible:!1})}},{key:"createDiffCodeMirror",value:function(e,t){var n=this.diffeditor.current;n.innerHTML="",this.diffeditor=window.CodeMirror.MergeView(n,{value:e||"",readOnly:!0,origLeft:null,orig:t||"",lineNumbers:!0,mode:this.mode,theme:"xq-light",highlightDifferences:!0,connect:"align",collapseIdentical:!1})}},{key:"confirmPub",value:function(){this.closeDialog(),this.props.publishConfig()}},{key:"render",value:function(){var e=this.props.locale,t=void 0===e?{}:e,n=U.a.createElement("div",null," ",U.a.createElement(_.a,{type:"primary",onClick:this.confirmPub.bind(this)},t.publish));return U.a.createElement("div",null,U.a.createElement(O.a,{title:t.contents,style:{width:"80%"},visible:this.state.dialogvisible,footer:n,onClose:this.closeDialog.bind(this)},U.a.createElement("div",{style:{height:400}},U.a.createElement("div",null,U.a.createElement($,null,U.a.createElement(Q,{style:{textAlign:"center"}},t.currentArea),U.a.createElement(Q,{style:{textAlign:"center"}},t.originalValue))),U.a.createElement("div",{style:{clear:"both",height:480},ref:this.diffeditor}))))}}]),n}(U.a.Component),o.displayName="DiffEditorDialog",a=r))||a,Z=(n(590),n(591),B.a.Row),ee=B.a.Col,te=[{value:"text",label:"TEXT"},{value:"json",label:"JSON"},{value:"xml",label:"XML"},{value:"yaml",label:"YAML"},{value:"html",label:"HTML"},{value:"properties",label:"Properties"}],ne=["production","beta"],ae=(0,z.a.config)((l=s=function(e){function n(e){var t;return Object(j.a)(this,n),(t=Object(A.a)(this,Object(R.a)(n).call(this,e))).state={loading:!1,isBeta:!1,isNewConfig:!0,betaPublishSuccess:!1,betaIps:"",tabActiveKey:"",form:{dataId:"",group:"",content:"",appName:"",desc:"",config_tags:[],type:"text"},tagDataSource:[],openAdvancedSettings:!1},t.successDialog=U.a.createRef(),t.diffEditorDialog=U.a.createRef(),t}return Object(H.a)(n,e),Object(I.a)(n,[{key:"componentDidMount",value:function(){var t=this,e=!Object(K.b)("dataId"),n=Object(K.b)("group").trim();this.setState({isNewConfig:e},function(){e?(n&&t.setState({group:n}),t.initMoacoEditor("text","")):t.changeForm({dataId:Object(K.b)("dataId").trim(),group:n},function(){return t.getConfig(!0).then(function(e){e?t.setState({isBeta:!0,tabActiveKey:"beta",betaPublishSuccess:!0}):t.getConfig()})})})}},{key:"initMoacoEditor",value:function(e,t){var n=this,a=document.getElementById("container");a.innerHTML="";var o={value:t,language:e,codeLens:!(this.monacoEditor=null),selectOnLineNumbers:!0,roundedSelection:!1,readOnly:!1,lineNumbersMinChars:!0,theme:"vs-dark",wordWrapColumn:120,folding:!1,showFoldingControls:"always",wordWrap:"wordWrapColumn",cursorStyle:"line",automaticLayout:!0};window.monaco?this.monacoEditor=window.monaco.editor.create(a,o):window.importEditor(function(){n.monacoEditor=window.monaco.editor.create(a,o)})}},{key:"createDiffCodeMirror",value:function(e,t){var n=this.diffEditorDialog.current.getInstance();n.innerHTML="",this.diffeditor=window.CodeMirror.MergeView(n,{value:e||"",origLeft:null,orig:t||"",lineNumbers:!0,mode:this.mode,theme:"xq-light",highlightDifferences:!0,connect:"align",collapseIdentical:!1})}},{key:"openDiff",value:function(e){this.diffcb=e;var t=this.monacoEditor.getValue(),n=this.codeVal||"";t=t.replace(/\r\n/g,"\n").replace(/\n/g,"\r\n"),n=n.replace(/\r\n/g,"\n").replace(/\n/g,"\r\n"),this.diffEditorDialog.current.getInstance().openDialog(t,n)}},{key:"clickTab",value:function(e){var t=this;console.log("tabActiveKey",e,"beta"===e),this.setState({tabActiveKey:e},function(){return t.getConfig("beta"===e)})}},{key:"getCodeVal",value:function(){var e=this.props.locale,t=void 0===e?{}:e,n=this.state.form,a=(n.type,n.content),o=this.monacoEditor?this.monacoEditor.getValue():a;return o||(P.a.error({content:t.submitFailed,align:"cc cc"}),!1)}},{key:"publish",value:function(){var n=this,e=this.props.locale,a=void 0===e?{}:e,t=this.state.form.type;this.state.isNewConfig&&this.validation();var o=this.getCodeVal();if(o)return G.a.validate({content:o,type:t})?this._publishConfig():new Promise(function(e,t){O.a.confirm({content:a.codeValErrorPrompt,onOk:function(){return e(n._publishConfig())},onCancel:function(){return e(!1)}})})}},{key:"_publishConfig",value:function(e){var t=this,n=0\n com.alibaba.nacos\n nacos-client\n ${latest.version}\n \n*/\npackage com.alibaba.nacos.example;\n\nimport java.util.Properties;\n\nimport com.alibaba.nacos.api.exception.NacosException;\nimport com.alibaba.nacos.api.naming.NamingFactory;\nimport com.alibaba.nacos.api.naming.NamingService;\nimport com.alibaba.nacos.api.naming.listener.Event;\nimport com.alibaba.nacos.api.naming.listener.EventListener;\nimport com.alibaba.nacos.api.naming.listener.NamingEvent;\n\n/**\n * @author nkorange\n */\npublic class NamingExample {\n\n public static void main(String[] args) throws NacosException {\n\n Properties properties = new Properties();\n properties.setProperty("serverAddr", System.getProperty("serverAddr"));\n properties.setProperty("namespace", System.getProperty("namespace"));\n\n NamingService naming = NamingFactory.createNamingService(properties);\n\n naming.registerInstance("'.concat(this.record.name,'", "11.11.11.11", 8888, "TEST1");\n\n naming.registerInstance("').concat(this.record.name,'", "2.2.2.2", 9999, "DEFAULT");\n\n System.out.println(naming.getAllInstances("').concat(this.record.name,'"));\n\n naming.deregisterInstance("').concat(this.record.name,'", "2.2.2.2", 9999, "DEFAULT");\n\n System.out.println(naming.getAllInstances("').concat(this.record.name,'"));\n\n naming.subscribe("').concat(this.record.name,'", new EventListener() {\n @Override\n public void onEvent(Event event) {\n System.out.println(((NamingEvent)event).getServiceName());\n System.out.println(((NamingEvent)event).getInstances());\n }\n });\n }\n}')}},{key:"getSpringCode",value:function(e){return'/* Refer to document: https://github.com/nacos-group/nacos-examples/tree/master/nacos-spring-example/nacos-spring-discovery-example\n* pom.xml\n \n com.alibaba.nacos\n nacos-spring-context\n ${latest.version}\n \n*/\n\n// Refer to document: https://github.com/nacos-group/nacos-examples/blob/master/nacos-spring-example/nacos-spring-discovery-example/src/main/java/com/alibaba/nacos/example/spring\npackage com.alibaba.nacos.example.spring;\n\nimport com.alibaba.nacos.api.annotation.NacosProperties;\nimport com.alibaba.nacos.spring.context.annotation.discovery.EnableNacosDiscovery;\nimport org.springframework.context.annotation.Configuration;\n\n@Configuration\n@EnableNacosDiscovery(globalProperties = @NacosProperties(serverAddr = "127.0.0.1:8848"))\npublic class NacosConfiguration {\n\n}\n\n// Refer to document: https://github.com/nacos-group/nacos-examples/tree/master/nacos-spring-example/nacos-spring-discovery-example/src/main/java/com/alibaba/nacos/example/spring/controller\npackage com.alibaba.nacos.example.spring.controller;\n\nimport com.alibaba.nacos.api.annotation.NacosInjected;\nimport com.alibaba.nacos.api.exception.NacosException;\nimport com.alibaba.nacos.api.naming.NamingService;\nimport com.alibaba.nacos.api.naming.pojo.Instance;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\nimport org.springframework.web.bind.annotation.ResponseBody;\n\nimport java.util.List;\n\nimport static org.springframework.web.bind.annotation.RequestMethod.GET;\n\n@Controller\n@RequestMapping("discovery")\npublic class DiscoveryController {\n\n @NacosInjected\n private NamingService namingService;\n\n @RequestMapping(value = "/get", method = GET)\n @ResponseBody\n public List get(@RequestParam String serviceName) throws NacosException {\n return namingService.getAllInstances(serviceName);\n }\n}'}},{key:"getSpringBootCode",value:function(e){return'/* Refer to document: https://github.com/nacos-group/nacos-examples/blob/master/nacos-spring-boot-example/nacos-spring-boot-discovery-example\n* pom.xml\n \n com.alibaba.boot\n nacos-discovery-spring-boot-starter\n ${latest.version}\n \n*/\n/* Refer to document: https://github.com/nacos-group/nacos-examples/blob/master/nacos-spring-boot-example/nacos-spring-boot-discovery-example/src/main/resources\n* application.properties\n nacos.discovery.server-addr=127.0.0.1:8848\n*/ \n// Refer to document: https://github.com/nacos-group/nacos-examples/blob/master/nacos-spring-boot-example/nacos-spring-boot-discovery-example/src/main/java/com/alibaba/nacos/example/spring/boot/controller\n\npackage com.alibaba.nacos.example.spring.boot.controller;\n\nimport com.alibaba.nacos.api.annotation.NacosInjected;\nimport com.alibaba.nacos.api.exception.NacosException;\nimport com.alibaba.nacos.api.naming.NamingService;\nimport com.alibaba.nacos.api.naming.pojo.Instance;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\nimport org.springframework.web.bind.annotation.ResponseBody;\n\nimport java.util.List;\n\nimport static org.springframework.web.bind.annotation.RequestMethod.GET;\n\n@Controller\n@RequestMapping("discovery")\npublic class DiscoveryController {\n\n @NacosInjected\n private NamingService namingService;\n\n @RequestMapping(value = "/get", method = GET)\n @ResponseBody\n public List get(@RequestParam String serviceName) throws NacosException {\n return namingService.getAllInstances(serviceName);\n }\n}'}},{key:"getSpringCloudCode",value:function(e){return"/* Refer to document: https://github.com/nacos-group/nacos-examples/blob/master/nacos-spring-cloud-example/nacos-spring-cloud-discovery-example/\n* pom.xml \n \n org.springframework.cloud\n spring-cloud-starter-alibaba-nacos-discovery\n ${latest.version}\n \n*/\n\n// nacos-spring-cloud-provider-example\n\n/* Refer to document: https://github.com/nacos-group/nacos-examples/tree/master/nacos-spring-cloud-example/nacos-spring-cloud-discovery-example/nacos-spring-cloud-provider-example/src/main/resources\n* application.properties\nserver.port=18080\nspring.application.name=".concat(this.record.name,'\nspring.cloud.nacos.discovery.server-addr=127.0.0.1:8848\n*/ \n\n// Refer to document: https://github.com/nacos-group/nacos-examples/tree/master/nacos-spring-cloud-example/nacos-spring-cloud-discovery-example/nacos-spring-cloud-provider-example/src/main/java/com/alibaba/nacos/example/spring/cloud\npackage com.alibaba.nacos.example.spring.cloud;\n\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\nimport org.springframework.cloud.client.discovery.EnableDiscoveryClient;\nimport org.springframework.web.bind.annotation.PathVariable;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestMethod;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author xiaojing\n */\n@SpringBootApplication\n@EnableDiscoveryClient \npublic class NacosProviderApplication {\n\n public static void main(String[] args) {\n SpringApplication.run(NacosProviderApplication.class, args);\n}\n\n @RestController\n class EchoController {\n @RequestMapping(value = "/echo/{string}", method = RequestMethod.GET)\n public String echo(@PathVariable String string) {\n return "Hello Nacos Discovery " + string;\n }\n }\n}\n\n// nacos-spring-cloud-consumer-example\n\n/* Refer to document: https://github.com/nacos-group/nacos-examples/tree/master/nacos-spring-cloud-example/nacos-spring-cloud-discovery-example/nacos-spring-cloud-consumer-example/src/main/resources\n* application.properties\nspring.application.name=micro-service-oauth2\nspring.cloud.nacos.discovery.server-addr=127.0.0.1:8848\n*/ \n\n// Refer to document: https://github.com/nacos-group/nacos-examples/tree/master/nacos-spring-cloud-example/nacos-spring-cloud-discovery-example/nacos-spring-cloud-consumer-example/src/main/java/com/alibaba/nacos/example/spring/cloud\npackage com.alibaba.nacos.example.spring.cloud;\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\nimport org.springframework.cloud.client.discovery.EnableDiscoveryClient;\nimport org.springframework.cloud.client.loadbalancer.LoadBalanced;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.web.bind.annotation.PathVariable;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestMethod;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.client.RestTemplate;\n\n/**\n * @author xiaojing\n */\n@SpringBootApplication\n@EnableDiscoveryClient\npublic class NacosConsumerApplication {\n\n @LoadBalanced\n @Bean\n public RestTemplate restTemplate() {\n return new RestTemplate();\n }\n\n public static void main(String[] args) {\n SpringApplication.run(NacosConsumerApplication.class, args);\n }\n\n @RestController\n public class TestController {\n\n private final RestTemplate restTemplate;\n\n @Autowired\n public TestController(RestTemplate restTemplate) {this.restTemplate = restTemplate;}\n\n @RequestMapping(value = "/echo/{str}", method = RequestMethod.GET)\n public String echo(@PathVariable String str) {\n return restTemplate.getForObject("http://service-provider/echo/" + str, String.class);\n }\n }\n}')}},{key:"getNodejsCode",value:function(e){return"TODO"}},{key:"getCppCode",value:function(e){return"TODO"}},{key:"getShellCode",value:function(e){return"TODO"}},{key:"getPythonCode",value:function(e){return"TODO"}},{key:"openDialog",value:function(e){var t=this;this.setState({dialogvisible:!0}),this.record=e,setTimeout(function(){t.getData()})}},{key:"closeDialog",value:function(){this.setState({dialogvisible:!1})}},{key:"createCodeMirror",value:function(e,t){var n=this.refs.codepreview;n&&(n.innerHTML="",this.cm=window.CodeMirror(n,{value:t,mode:e,height:400,width:500,lineNumbers:!0,theme:"xq-light",lint:!0,tabMode:"indent",autoMatchParens:!0,textWrapping:!0,gutters:["CodeMirror-lint-markers"],extraKeys:{F1:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)}}}),this.cm.setSize("auto","490px"))}},{key:"changeTab",value:function(e,t){var n=this;setTimeout(function(){n[e]=!0,n.createCodeMirror("text/javascript",t)})}},{key:"render",value:function(){var e=this.props.locale,t=void 0===e?{}:e,n=z.a.createElement("div",null);return z.a.createElement("div",null,z.a.createElement(y.a,{title:t.sampleCode,style:{width:"80%"},visible:this.state.dialogvisible,footer:n,onClose:this.closeDialog.bind(this)},z.a.createElement("div",{style:{height:500}},z.a.createElement(S.a,{tip:t.loading,style:{width:"100%"},visible:this.state.loading},z.a.createElement(K.a,{shape:"text",style:{height:40,paddingBottom:10}},z.a.createElement(q,{title:"Java",key:0,onClick:this.changeTab.bind(this,"commoneditor1",this.defaultCode)}),z.a.createElement(q,{title:"Spring",key:1,onClick:this.changeTab.bind(this,"commoneditor1",this.springCode)}),z.a.createElement(q,{title:"Spring Boot",key:2,onClick:this.changeTab.bind(this,"commoneditor2",this.sprigbootCode)}),z.a.createElement(q,{title:"Spring Cloud",key:21,onClick:this.changeTab.bind(this,"commoneditor21",this.sprigcloudCode)}),z.a.createElement(q,{title:"Node.js",key:3,onClick:this.changeTab.bind(this,"commoneditor3",this.nodejsCode)}),z.a.createElement(q,{title:"C++",key:4,onClick:this.changeTab.bind(this,"commoneditor4",this.cppCode)}),z.a.createElement(q,{title:"Shell",key:5,onClick:this.changeTab.bind(this,"commoneditor5",this.shellCode)}),z.a.createElement(q,{title:"Python",key:6,onClick:this.changeTab.bind(this,"commoneditor6",this.pythonCode)})),z.a.createElement("div",{ref:"codepreview"})))))}}]),n}(z.a.Component),o.displayName="ShowServiceCodeing",a=r))||a,J=(n(642),H.a.Item),$=A.a.Row,Q=A.a.Col,X=j.a.Column,Z=(0,Y.a.config)((l=s=function(e){function t(e){var n;return Object(b.a)(this,t),(n=Object(w.a)(this,Object(k.a)(t).call(this,e))).getQueryLater=function(){setTimeout(function(){return n.queryServiceList()})},n.showcode=function(){setTimeout(function(){return n.queryServiceList()})},n.setNowNameSpace=function(e,t){return n.setState({nowNamespaceName:e,nowNamespaceId:t})},n.rowColor=function(e){return{className:e.healthyInstanceCount?"":"row-bg-red"}},n.editServiceDialog=z.a.createRef(),n.showcode=z.a.createRef(),n.state={loading:!1,total:0,pageSize:10,currentPage:1,dataSource:[],search:{serviceName:"",groupName:""},hasIpCount:!("false"===localStorage.getItem("hasIpCount"))},n.field=new v.a(Object(D.a)(n)),n}return Object(N.a)(t,e),Object(M.a)(t,[{key:"openLoading",value:function(){this.setState({loading:!0})}},{key:"closeLoading",value:function(){this.setState({loading:!1})}},{key:"openEditServiceDialog",value:function(){try{this.editServiceDialog.current.getInstance().show(this.state.service)}catch(e){}}},{key:"queryServiceList",value:function(){var i=this,e=this.state,t=e.currentPage,n=e.pageSize,a=e.search,o=e.withInstances,r=void 0!==o&&o,s=e.hasIpCount,l=["hasIpCount=".concat(s),"withInstances=".concat(r),"pageNo=".concat(t),"pageSize=".concat(n),"serviceNameParam=".concat(a.serviceName),"groupNameParam=".concat(a.groupName)];Object(W.c)({url:"v1/ns/catalog/services?".concat(l.join("&")),beforeSend:function(){return i.openLoading()},success:function(e){var t=0this.state.pageSize&&z.a.createElement("div",{style:{marginTop:10,textAlign:"right"}},z.a.createElement(T.a,{current:this.state.currentPage,total:this.state.total,pageSize:this.state.pageSize,onChange:function(e){return a.setState({currentPage:e},function(){return a.queryServiceList()})}}))),z.a.createElement(G,{ref:this.showcode}),z.a.createElement(V.a,{ref:this.editServiceDialog,openLoading:function(){return a.openLoading()},closeLoading:function(){return a.closeLoading()},queryServiceList:function(){return a.setState({currentPage:1},function(){return a.queryServiceList()})}}))}}]),t}(z.a.Component),s.displayName="ServiceList",i=l))||i;t.a=Z},function(e,t,n){"use strict";n(31);var a,o,r,i=n(19),s=n.n(i),l=(n(34),n(10)),u=n.n(l),c=(n(38),n(21)),d=n.n(c),p=(n(42),n(29)),f=n.n(p),h=n(14),m=n(15),g=n(16),y=n(17),_=n(22),v=n(18),b=(n(28),n(9)),M=n.n(b),w=(n(37),n(8)),k=n.n(w),S=n(0),T=n.n(S),C=n(1),x=(n(598),k.a.Item),E=(0,M.a.config)((r=o=function(e){function n(e){var t;return Object(h.a)(this,n),(t=Object(g.a)(this,Object(y.a)(n).call(this,e))).field=new f.a(Object(_.a)(t)),t.dataId=Object(C.b)("dataId")||"yanlin",t.group=Object(C.b)("group")||"DEFAULT_GROUP",t.serverId=Object(C.b)("serverId")||"center",t.nid=Object(C.b)("nid")||"",t.state={envName:"",visible:!1,showmore:!1},t}return Object(v.a)(n,e),Object(m.a)(n,[{key:"componentDidMount",value:function(){var e=this.props.locale,t=void 0===e?{}:e;this.typeMap={U:"publish",I:t.rollbackDelete,D:"publish"},this.typeMapName={U:t.update,I:t.insert,D:t.rollbackDelete},this.getDataDetail()}},{key:"toggleMore",value:function(){this.setState({showmore:!this.state.showmore})}},{key:"getDataDetail",value:function(){var a=this;this.tenant=Object(C.b)("namespace")||"",this.serverId=Object(C.b)("serverId")||"center";var e="v1/cs/history?dataId=".concat(this.dataId,"&group=").concat(this.group,"&nid=").concat(this.nid);Object(C.c)({url:e,success:function(e){if(null!=e){var t=e,n=a.serverId;a.id=t.id,a.field.setValue("dataId",t.dataId),a.field.setValue("content",t.content),a.field.setValue("appName",t.appName),a.field.setValue("opType",a.typeMapName[t.opType.trim()]),a.opType=t.opType,a.field.setValue("group",t.group),a.field.setValue("md5",t.md5),a.field.setValue("envName",n),a.setState({envName:n})}}})}},{key:"goList",value:function(){var e=Object(C.b)("namespace");this.props.history.push("/historyRollback?serverId=".concat(this.serverId,"&group=").concat(this.group,"&dataId=").concat(this.dataId,"&namespace=").concat(e))}},{key:"onOpenConfirm",value:function(){var e=this.props.locale,n=void 0===e?{}:e,a=this,o="post";"I"===this.opType.trim()&&(o="delete"),d.a.confirm({title:n.rollBack,content:T.a.createElement("div",{style:{marginTop:"-20px"}},T.a.createElement("h3",null,n.determine," ",n.followingConfiguration),T.a.createElement("p",null,T.a.createElement("span",{style:{color:"#999",marginRight:5}},"Data ID:"),T.a.createElement("span",{style:{color:"#c7254e"}},a.field.getValue("dataId"))),T.a.createElement("p",null,T.a.createElement("span",{style:{color:"#999",marginRight:5}},"Group:"),T.a.createElement("span",{style:{color:"#c7254e"}},a.field.getValue("group")))),onOk:function(){a.tenant=Object(C.b)("namespace")||"",a.serverId=Object(C.b)("serverId")||"center",a.dataId=a.field.getValue("dataId"),a.group=a.field.getValue("group");var e={appName:a.field.getValue("appName"),dataId:a.dataId,group:a.group,content:a.field.getValue("content"),tenant:a.tenant},t="v1/cs/configs";"I"===a.opType.trim()&&(t="v1/cs/configs?dataId=".concat(a.dataId,"&group=").concat(a.group),e={}),Object(C.c)({type:o,contentType:"application/x-www-form-urlencoded",url:t,data:e,success:function(e){!0===e&&d.a.alert({content:n.rollbackSuccessful})}})}})}},{key:"render",value:function(){var e=this.props.locale,t=void 0===e?{}:e,n=this.field.init,a={labelCol:{fixedSpan:6},wrapperCol:{span:18}};return T.a.createElement("div",{style:{padding:10}},T.a.createElement("h1",null,t.configurationRollback),T.a.createElement(k.a,{field:this.field},T.a.createElement(x,Object.assign({label:"Data ID:",required:!0},a),T.a.createElement(u.a,Object.assign({htmlType:"text",readOnly:!0},n("dataId"))),T.a.createElement("div",{style:{marginTop:10}},T.a.createElement("a",{style:{fontSize:"12px"},onClick:this.toggleMore.bind(this)},this.state.showmore?t.collapse:t.more))),T.a.createElement("div",{style:{overflow:"hidden",height:this.state.showmore?"auto":"0"}},T.a.createElement(x,Object.assign({label:"Group:",required:!0},a),T.a.createElement(u.a,Object.assign({htmlType:"text",readOnly:!0},n("group")))),T.a.createElement(x,Object.assign({label:t.home},a),T.a.createElement(u.a,Object.assign({htmlType:"text",readOnly:!0},n("appName"))))),T.a.createElement(x,Object.assign({label:t.actionType,required:!0},a),T.a.createElement(u.a,Object.assign({htmlType:"text",readOnly:!0},n("opType")))),T.a.createElement(x,Object.assign({label:"MD5:",required:!0},a),T.a.createElement(u.a,Object.assign({htmlType:"text",readOnly:!0},n("md5")))),T.a.createElement(x,Object.assign({label:t.configuration,required:!0},a),T.a.createElement(u.a.TextArea,Object.assign({htmlType:"text",multiple:!0,rows:15,readOnly:!0},n("content")))),T.a.createElement(x,Object.assign({label:" "},a),T.a.createElement(s.a,{type:"primary",style:{marginRight:10},onClick:this.onOpenConfirm.bind(this)},t.rollBack),T.a.createElement(s.a,{type:"normal",onClick:this.goList.bind(this)},t.back))))}}]),n}(T.a.Component),o.displayName="ConfigRollback",a=r))||a;t.a=E},function(e,t,n){"use strict";n(39);var a,o,r,i=n(26),s=n.n(i),l=(n(31),n(19)),u=n.n(l),c=(n(34),n(10)),d=n.n(c),p=(n(38),n(21)),f=n.n(p),h=(n(42),n(29)),m=n.n(h),g=n(14),y=n(15),_=n(16),v=n(17),b=n(22),M=n(18),w=(n(28),n(9)),k=n.n(w),S=(n(37),n(8)),T=n.n(S),C=(n(111),n(51)),x=n.n(C),E=n(0),L=n.n(E),D=n(1),N=(n(588),x.a.Item),O=T.a.Item,Y=(0,k.a.config)((r=o=function(e){function n(e){var t;return Object(g.a)(this,n),(t=Object(_.a)(this,Object(v.a)(n).call(this,e))).state={loading:!1,showmore:!1,activeKey:"normal",hasbeta:!1,ips:"",checkedBeta:!1,switchEncrypt:!1,tag:[]},t.field=new m.a(Object(b.a)(t)),t.dataId=Object(D.b)("dataId")||"yanlin",t.group=Object(D.b)("group")||"DEFAULT_GROUP",t.ips="",t.valueMap={},t.tenant=Object(D.b)("namespace")||"",t.searchDataId=Object(D.b)("searchDataId")||"",t.searchGroup=Object(D.b)("searchGroup")||"",t}return Object(M.a)(n,e),Object(y.a)(n,[{key:"componentDidMount",value:function(){this.initData(),this.getDataDetail()}},{key:"initData",value:function(){var e=this.props.locale,t=void 0===e?{}:e;this.dataId.startsWith("cipher-")&&this.setState({switchEncrypt:!0}),this.setState({tag:[{title:t.official,key:"normal"}]})}},{key:"openLoading",value:function(){this.setState({loading:!0})}},{key:"closeLoading",value:function(){this.setState({loading:!1})}},{key:"changeTab",value:function(e){var t=e.split("-")[0],n=this.valueMap[t];this.setState({activeKey:e}),this.field.setValue("content",n.content),n.betaIps&&this.setState({ips:n.betaIps})}},{key:"toggleMore",value:function(){this.setState({showmore:!this.state.showmore})}},{key:"getDataDetail",value:function(){var e=this.props.locale,n=void 0===e?{}:e,a=this;this.serverId=Object(D.b)("serverId")||"center",this.tenant=Object(D.b)("namespace")||"",this.edasAppName=Object(D.b)("edasAppName")||"",this.inApp=this.edasAppName;var t="v1/cs/configs?show=all&dataId=".concat(this.dataId,"&group=").concat(this.group);Object(D.c)({url:t,beforeSend:function(){a.openLoading()},success:function(e){if(null!=e){var t=e;a.valueMap.normal=t,a.field.setValue("dataId",t.dataId),a.field.setValue("content",t.content),a.field.setValue("appName",a.inApp?a.edasAppName:t.appName),a.field.setValue("envs",a.serverId),a.field.setValue("group",t.group),a.field.setValue("config_tags",t.configTags),a.field.setValue("desc",t.desc),a.field.setValue("md5",t.md5)}else f.a.alert({title:n.error,content:e.message})},complete:function(){a.closeLoading()}})}},{key:"goList",value:function(){this.props.history.push("/configurationManagement?serverId=".concat(this.serverId,"&group=").concat(this.searchGroup,"&dataId=").concat(this.searchDataId,"&namespace=").concat(this.tenant))}},{key:"render",value:function(){var e=this.props.locale,t=void 0===e?{}:e,n=this.field.init,a={labelCol:{span:2},wrapperCol:{span:22}},o=this.state.activeKey.split("-")[0];return L.a.createElement("div",{style:{padding:10}},L.a.createElement(s.a,{shape:"flower",tip:"Loading...",style:{width:"100%",position:"relative"},visible:this.state.loading,color:"#333"},L.a.createElement("h1",{style:{position:"relative",width:"100%"}},t.configurationDetails),this.state.hasbeta?L.a.createElement("div",{style:{display:"inline-block",height:40,width:"80%",overflow:"hidden"}},L.a.createElement(x.a,{shape:"wrapped",onChange:this.changeTab.bind(this),lazyLoad:!1,activeKey:this.state.activeKey},this.state.tag.map(function(e){return L.a.createElement(N,{title:e.title,key:e.key})}))):"",L.a.createElement(T.a,{inline:!1,field:this.field},L.a.createElement(O,Object.assign({label:"Data ID:",required:!0},a),L.a.createElement(d.a,Object.assign({htmlType:"text",readOnly:!0},n("dataId")))),L.a.createElement(O,Object.assign({label:"Group:",required:!0},a),L.a.createElement(d.a,Object.assign({htmlType:"text",readOnly:!0},n("group")))),L.a.createElement("div",{style:{marginTop:10}},L.a.createElement("a",{style:{fontSize:"12px"},onClick:this.toggleMore.bind(this)},this.state.showmore?t.collapse:t.more)),this.state.showmore?L.a.createElement("div",null,L.a.createElement(O,Object.assign({label:t.home},a),L.a.createElement(d.a,Object.assign({htmlType:"text",readOnly:!0},n("appName")))),L.a.createElement(O,Object.assign({label:t.tags},a),L.a.createElement(d.a,Object.assign({htmlType:"text",readOnly:!0},n("config_tags"))))):"",L.a.createElement(O,Object.assign({label:t.description},a),L.a.createElement(d.a.TextArea,Object.assign({htmlType:"text",multiple:!0,rows:3,readOnly:!0},n("desc")))),"normal"===o?"":L.a.createElement(O,Object.assign({label:t.betaRelease},a),L.a.createElement("div",{style:{width:"100%"},id:"betaips"},L.a.createElement(d.a.TextArea,{multiple:!0,style:{width:"100%"},value:this.state.ips,readOnly:!0,placeholder:"127.0.0.1,127.0.0.2"}))),L.a.createElement(O,Object.assign({label:"MD5:",required:!0},a),L.a.createElement(d.a,Object.assign({htmlType:"text",readOnly:!0},n("md5")))),L.a.createElement(O,Object.assign({label:t.configuration,required:!0},a),L.a.createElement(d.a.TextArea,Object.assign({htmlType:"text",multiple:!0,rows:15,readOnly:!0},n("content")))),L.a.createElement(O,Object.assign({label:" "},a),L.a.createElement(u.a,{type:"primary",onClick:this.goList.bind(this)},t.back)))))}}]),n}(L.a.Component),o.displayName="ConfigDetail",a=r))||a;t.a=Y},function(e,t,n){"use strict";n(39);var a,o,r,i=n(26),s=n.n(i),l=(n(31),n(19)),u=n.n(l),c=(n(339),n(118)),d=n.n(c),p=(n(33),n(23)),f=n.n(p),h=(n(34),n(10)),m=n.n(h),g=(n(42),n(29)),y=n.n(g),_=(n(38),n(21)),v=n.n(_),b=(n(44),n(24)),M=n.n(b),w=n(14),k=n(15),S=n(16),T=n(17),C=n(22),x=n(18),E=(n(28),n(9)),L=n.n(E),D=(n(62),n(32)),N=n.n(D),O=(n(105),n(71)),Y=n.n(O),P=(n(37),n(8)),j=n.n(P),I=n(46),A=n.n(I),R=n(0),H=n.n(R),F=n(85),z=n(1),W=n(119),B=(n(581),j.a.Item),V=Y.a.Group,U=N.a.AutoComplete,K=(0,L.a.config)((r=o=function(e){function t(e){var u;return Object(w.a)(this,t),(u=Object(S.a)(this,Object(T.a)(t).call(this,e))).publicConfigBeforeCheck=function(t){var e=u.props.locale,n=void 0===e?{}:e,a=u.state.addonBefore;Object(z.c)({url:"v1/cs/configs",data:{show:"all",dataId:a+u.field.getValue("dataId"),group:u.field.getValue("group"),tenant:Object(z.b)("namespace")||""},success:function(e){M.a.error({content:n.dataIdExists,align:"cc cc"})},error:function(e){u._publishConfig(t)}})},u._publishConfig=function(e){var n=Object(C.a)(u),t=u.props.locale,a=void 0===t?{}:t,o=u.state,r=o.addonBefore,i=o.config_tags,s=o.configType;u.tenant=Object(z.b)("namespace")||"";var l={dataId:r+u.field.getValue("dataId"),group:u.field.getValue("group"),content:e,desc:u.field.getValue("desc"),config_tags:i.join(),type:s,appName:u.inApp?u.edasAppId:u.field.getValue("appName"),tenant:u.tenant};u.serverId=Object(z.b)("serverId")||"center";Object(z.c)({type:"post",contentType:"application/x-www-form-urlencoded",url:"v1/cs/configs",data:l,beforeSend:function(){u.openLoading()},success:function(e){var t={};t.maintitle=a.newListingMain,t.title=a.newListing,t.content="",t.dataId=l.dataId,t.group=l.group,!0===e?(n.group=l.group,n.dataId=l.dataId,Object(z.d)({group:l.group,dataId:l.dataId}),t.isok=!0):(t.isok=!1,t.message=e.message),n.successDialog.current.getInstance().openDialog(t)},complete:function(){n.closeLoading()},error:function(e){v.a.alert({language:z.a.currentLanguageCode||"zh-cn",content:a.publishFailed}),n.closeLoading()}})},u.successDialog=H.a.createRef(),u.field=new y.a(Object(C.a)(u)),u.edasAppName=Object(z.b)("edasAppName")||"",u.edasAppId=Object(z.b)("edasAppId")||"",u.inApp=u.edasAppName,u.field.setValue("appName",u.inApp?u.edasAppName:""),u.inEdas=window.globalConfig.isParentEdas(),u.dataId=Object(z.b)("dataId")||"",u.group=Object(z.b)("group")||"DEFAULT_GROUP",u.searchDataId=Object(z.b)("searchDataId")||"",u.searchGroup=Object(z.b)("searchGroup")||"",u.state={configType:"text",codeValue:"",envname:"",targetEnvName:"",groups:[],groupNames:[],envlist:[],tagLst:[],config_tags:[],envvalues:[],showmore:!1,loading:!1,encrypt:!1,addonBefore:"",showGroupWarning:!1},u.codeValue="",u.mode="text",u.ips="",u}return Object(x.a)(t,e),Object(k.a)(t,[{key:"componentDidMount",value:function(){var e=this;this.betaips=document.getElementById("betaips"),this.chontenttab=document.getElementById("chontenttab"),this.tenant=Object(z.b)("namespace")||"",this.field.setValue("group",this.group),window.monaco?this.initMoacoEditor():window.importEditor(function(){e.initMoacoEditor()})}},{key:"changeModel",value:function(e){if(!this.monacoEditor)return A()("#container").empty(),void(this.monacoEditor=window.monaco.editor.create(document.getElementById("container"),{model:null}));var t=this.monacoEditor.getModel(),n=this.monacoEditor.getValue(),a=window.monaco.editor.createModel(n,e);this.monacoEditor.setModel(a),t&&t.dispose()}},{key:"initMoacoEditor",value:function(){this.monacoEditor=window.monaco.editor.create(document.getElementById("container"),{value:this.codeValue,language:this.state.configType,codeLens:!0,selectOnLineNumbers:!0,roundedSelection:!1,readOnly:!1,lineNumbersMinChars:!0,theme:"vs-dark",wordWrapColumn:120,folding:!0,showFoldingControls:"always",wordWrap:"wordWrapColumn",cursorStyle:"line",automaticLayout:!0})}},{key:"setGroup",value:function(e){this.group=e||"",this.field.setValue("group",this.group),this.inEdas&&this.setState({showGroupWarning:""!==this.group&&this.state.groupNames.indexOf(e)<0})}},{key:"setConfigTags",value:function(n){5this.state.pageSize&&P.a.createElement("div",{style:{marginTop:10,textAlign:"right"}},P.a.createElement(T.a,{current:this.state.pageNo,total:s,pageSize:this.state.pageSize,onChange:function(e){return t.setState({pageNo:e},function(){return t.querySubscriberList()})}}))))}}]),t}(P.a.Component),o.displayName="SubscriberList",a=r))||a)||a;t.a=W},function(e,t,n){"use strict";n(39);var a,o,r,i=n(26),m=n.n(i),s=(n(63),n(40)),g=n.n(s),l=(n(31),n(19)),y=n.n(l),u=(n(34),n(10)),_=n.n(u),c=(n(42),n(29)),d=n.n(c),p=n(14),f=n(15),h=n(16),v=n(17),b=n(22),M=n(18),w=(n(28),n(9)),k=n.n(w),S=(n(61),n(20)),T=n.n(S),C=(n(54),n(30)),x=n.n(C),E=(n(37),n(8)),L=n.n(E),D=n(0),N=n.n(D),O=n(1),Y=n(41),P=(n(645),L.a.Item),j=x.a.Row,I=x.a.Col,A=T.a.Column,R=(0,k.a.config)((r=o=function(e){function t(e){var n;return Object(p.a)(this,t),(n=Object(h.a)(this,Object(v.a)(t).call(this,e))).getQueryLater=function(){setTimeout(function(){return n.queryClusterStateList()})},n.setNowNameSpace=function(e,t){return n.setState({nowNamespaceName:e,nowNamespaceId:t})},n.rowColor=function(e){return{className:(e.voteFor,"")}},n.state={loading:!1,total:0,pageSize:10,currentPage:1,keyword:"",dataSource:[]},n.field=new d.a(Object(b.a)(n)),n}return Object(M.a)(t,e),Object(f.a)(t,[{key:"openLoading",value:function(){this.setState({loading:!0})}},{key:"closeLoading",value:function(){this.setState({loading:!1})}},{key:"openEditServiceDialog",value:function(){try{this.editServiceDialog.current.getInstance().show(this.state.service)}catch(e){}}},{key:"queryClusterStateList",value:function(){var i=this,e=this.state,t=e.currentPage,n=e.pageSize,a=e.keyword,o=e.withInstances,r=["withInstances=".concat(void 0!==o&&o),"pageNo=".concat(t),"pageSize=".concat(n),"keyword=".concat(a)];Object(O.c)({url:"v1/ns/operator/cluster/states?".concat(r.join("&")),beforeSend:function(){return i.openLoading()},success:function(e){var t=0this.state.pageSize&&N.a.createElement("div",{style:{marginTop:10,textAlign:"right"}},N.a.createElement(g.a,{current:this.state.currentPage,total:this.state.total,pageSize:this.state.pageSize,onChange:function(e){return t.setState({currentPage:e},function(){return t.queryClusterStateList()})}}))))}}]),t}(N.a.Component),o.displayName="ClusterNodeList",a=r))||a;t.a=R},function(e,t,n){"use strict";n(39);var a,o,r,i=n(26),s=n.n(i),l=(n(31),n(19)),u=n.n(l),c=(n(92),n(59)),d=n.n(c),p=(n(37),n(8)),f=n.n(p),h=(n(34),n(10)),m=n.n(h),g=(n(38),n(21)),y=n.n(g),_=(n(42),n(29)),v=n.n(_),b=n(14),M=n(15),w=n(16),k=n(17),S=n(22),T=n(18),C=(n(28),n(9)),x=n.n(C),E=n(0),L=n.n(E),D=n(85),N=n(1),O=(n(582),(0,x.a.config)((r=o=function(e){function n(e){var t;return Object(b.a)(this,n),(t=Object(w.a)(this,Object(k.a)(n).call(this,e))).successDialog=L.a.createRef(),t.field=new v.a(Object(S.a)(t)),t.dataId=Object(N.b)("dataId")||"yanlin",t.group=Object(N.b)("group")||"",t.serverId=Object(N.b)("serverId")||"",t.state={configType:0,envvalues:[],commonvalue:[],envComponent:"",envGroups:[],envlist:[],loading:!1,showmore:!1},t.codeValue="",t.mode="text",t.ips="",t}return Object(T.a)(n,e),Object(M.a)(n,[{key:"componentDidMount",value:function(){this.getDataDetail()}},{key:"toggleMore",value:function(){this.setState({showmore:!this.state.showmore})}},{key:"getEnvList",value:function(e){this.setState({envvalues:e}),this.envs=e}},{key:"getDomain",value:function(){var n=this;Object(N.c)({url:"/diamond-ops/env/domain",success:function(e){if(200===e.code){var t=e.data.envGroups;n.setState({envGroups:t})}}})}},{key:"getDataDetail",value:function(){var s=this,e=this.props.locale,l=void 0===e?{}:e;this.tenant=Object(N.b)("namespace")||"",this.serverId=Object(N.b)("serverId")||"center";var t="/diamond-ops/configList/detail/serverId/".concat(this.serverId,"/dataId/").concat(this.dataId,"/group/").concat(this.group,"/tenant/").concat(this.tenant,"?id=");"global"!==this.tenant&&this.tenant||(t="/diamond-ops/configList/detail/serverId/".concat(this.serverId,"/dataId/").concat(this.dataId,"/group/").concat(this.group,"?id=")),Object(N.c)({url:t,beforeSend:function(){s.openLoading()},success:function(e){if(200===e.code){var t=e.data,n=void 0===t?{}:t;s.field.setValue("dataId",n.dataId),s.field.setValue("appName",n.appName),s.field.setValue("group",n.group),s.field.setValue("content",n.content||"");for(var a=n.envs||[],o=[],r=[],i=0;i outside a "),this.isStatic()&&this.perform()},b.prototype.componentDidMount=function(){this.isStatic()||this.perform()},b.prototype.componentDidUpdate=function(e){var t=Object(d.b)(e.to),n=Object(d.b)(this.props.to);Object(d.c)(t,n)?l()(!1,"You tried to redirect to the same route you're currently on: \""+n.pathname+n.search+'"'):this.perform()},b.prototype.computeTo=function(e){var t=e.computedMatch,n=e.to;return t?"string"==typeof n?g(n,t.params):y({},n,{pathname:g(n.pathname,t.params)}):n},b.prototype.perform=function(){var e=this.context.router.history,t=this.props.push,n=this.computeTo(this.props);t?e.push(n):e.replace(n)},b.prototype.render=function(){return null},b);function b(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,b),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,_.apply(this,arguments))}v.propTypes={computedMatch:i.a.object,push:i.a.bool,from:i.a.string,to:i.a.oneOfType([i.a.string,i.a.object]).isRequired},v.defaultProps={push:!1},v.contextTypes={router:i.a.shape({history:i.a.shape({push:i.a.func.isRequired,replace:i.a.func.isRequired}).isRequired,staticContext:i.a.object}).isRequired};var M=v;t.a=M},function(e,t,n){"use strict";var a=n(0),o=n.n(a),r=n(2),i=n.n(r),s=n(149),l=n.n(s),u=n(113),c=Object.assign||function(e){for(var t=1;t=t.length?{value:void 0,done:!0}:(e=a(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){var l=n(123),u=n(122);e.exports=function(s){return function(e,t){var n,a,o=String(u(e)),r=l(t),i=o.length;return r<0||i<=r?s?"":void 0:(n=o.charCodeAt(r))<55296||56319=e.length?(this._t=void 0,o(1)):o(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values"),r.Arguments=r.Array,a("keys"),a("values"),a("entries")},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){e.exports={default:n(413),__esModule:!0}},function(e,t,n){n(414),n(419),n(420),n(421),e.exports=n(68).Symbol},function(e,t,n){"use strict";function a(e){var t=q[e]=D(H[W]);return t._k=e,t}function o(e,t){S(e);for(var n,a=w(t=x(t)),o=0,r=a.length;oo;)c(q,t=n[o++])||t==B||t==h||a.push(t);return a}function l(e){for(var t,n=e===J,a=R(n?G:x(e)),o=[],r=0;a.length>r;)!c(q,t=a[r++])||n&&!c(J,t)||o.push(q[t]);return o}var u=n(60),c=n(70),d=n(69),p=n(89),f=n(161),h=n(415).KEY,m=n(91),g=n(125),y=n(131),_=n(103),v=n(78),b=n(132),M=n(133),w=n(416),k=n(417),S=n(90),T=n(76),C=n(128),x=n(77),E=n(121),L=n(100),D=n(130),N=n(418),O=n(163),Y=n(127),P=n(75),j=n(101),I=O.f,A=P.f,R=N.f,H=u.Symbol,F=u.JSON,z=F&&F.stringify,W="prototype",B=v("_hidden"),V=v("toPrimitive"),U={}.propertyIsEnumerable,K=g("symbol-registry"),q=g("symbols"),G=g("op-symbols"),J=Object[W],$="function"==typeof H&&!!Y.f,Q=u.QObject,X=!Q||!Q[W]||!Q[W].findChild,Z=d&&m(function(){return 7!=D(A({},"a",{get:function(){return A(this,"a",{value:7}).a}})).a})?function(e,t,n){var a=I(J,t);a&&delete J[t],A(e,t,n),a&&e!==J&&A(J,t,a)}:A,ee=$&&"symbol"==typeof H.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof H},te=function(e,t,n){return e===J&&te(G,t,n),S(e),t=E(t,!0),S(n),c(q,t)?(n.enumerable?(c(e,B)&&e[B][t]&&(e[B][t]=!1),n=D(n,{enumerable:L(0,!1)})):(c(e,B)||A(e,B,L(1,{})),e[B][t]=!0),Z(e,t,n)):A(e,t,n)};$||(f((H=function(e){if(this instanceof H)throw TypeError("Symbol is not a constructor!");var t=_(0ae;)v(ne[ae++]);for(var oe=j(v.store),re=0;oe.length>re;)M(oe[re++]);p(p.S+p.F*!$,"Symbol",{for:function(e){return c(K,e+="")?K[e]:K[e]=H(e)},keyFor:function(e){if(!ee(e))throw TypeError(e+" is not a symbol!");for(var t in K)if(K[t]===e)return t},useSetter:function(){X=!0},useSimple:function(){X=!1}}),p(p.S+p.F*!$,"Object",{create:function(e,t){return void 0===t?D(e):o(D(e),t)},defineProperty:te,defineProperties:o,getOwnPropertyDescriptor:i,getOwnPropertyNames:s,getOwnPropertySymbols:l});var ie=m(function(){Y.f(1)});p(p.S+p.F*ie,"Object",{getOwnPropertySymbols:function(e){return Y.f(C(e))}}),F&&p(p.S+p.F*(!$||m(function(){var e=H();return"[null]"!=z([e])||"{}"!=z({a:e})||"{}"!=z(Object(e))})),"JSON",{stringify:function(e){for(var t,n,a=[e],o=1;oi;)r.call(e,a=o[i++])&&t.push(a);return t}},function(e,t,n){var a=n(159);e.exports=Array.isArray||function(e){return"Array"==a(e)}},function(e,t,n){var a=n(77),o=n(162).f,r={}.toString,i="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return i&&"[object Window]"==r.call(e)?function(e){try{return o(e)}catch(e){return i.slice()}}(e):o(a(e))}},function(e,t){},function(e,t,n){n(133)("asyncIterator")},function(e,t,n){n(133)("observable")},function(e,t,n){e.exports={default:n(423),__esModule:!0}},function(e,t,n){n(424),e.exports=n(68).Object.setPrototypeOf},function(e,t,n){var a=n(89);a(a.S,"Object",{setPrototypeOf:n(425).set})},function(e,t,o){function r(e,t){if(a(e),!n(t)&&null!==t)throw TypeError(t+": can't set as prototype!")}var n=o(76),a=o(90);e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,n,a){try{(a=o(154)(Function.call,o(163).f(Object.prototype,"__proto__").set,2))(e,[]),n=!(e instanceof Array)}catch(e){n=!0}return function(e,t){return r(e,t),n?e.__proto__=t:a(e,t),e}}({},!1):void 0),check:r}},function(e,t,n){e.exports={default:n(427),__esModule:!0}},function(e,t,n){n(428);var a=n(68).Object;e.exports=function(e,t){return a.create(e,t)}},function(e,t,n){var a=n(89);a(a.S,"Object",{create:n(130)})},function(e,t,n){"use strict"; +*/var l=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var a={};return"abcdefghijklmnopqrst".split("").forEach(function(e){a[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},a)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,o=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),r=1;re.clientHeight&&0a.length&&a.every(function(e,t){return e===n[t]})},k.prototype.handleOpen=function(t,e,n,a){var o=this,r=void 0,i=this.props,s=i.mode,l=i.openMode,u=this.state.openKeys,c=u.indexOf(t);e&&-1===c?"inline"===s?"single"===l?(r=u.filter(function(e){return!o.isSibling(o.k2n[t].pos,o.k2n[e].pos)})).push(t):r=u.concat(t):(r=u.filter(function(e){return o.isAncestor(o.k2n[t].pos,o.k2n[e].pos)})).push(t):!e&&-1this.popupNode.offsetWidth&&y(this.popupNode,"width",f.offsetWidth+"px")}"outside"!==u||"hoz"===l&&1===n||(y(this.popupNode,"height",p.offsetHeight+"px"),y(this.popupNode,"overflow-y","scroll"));var h=this.popupProps;h.onOpen&&h.onOpen()},P.prototype.handlePopupClose=function(){var e=this.props.root.popupNodes,t=e.indexOf(this.popupNode);-1 "+this.message+" (line "+this.parsedLine+": '"+this.snippet+"')":" "+this.message},n=a,e.exports=n},function(e,t){var n,o={}.hasOwnProperty;function a(e,t,n){this.message=e,this.parsedLine=t,this.snippet=n}(function(e,t){for(var n in t)o.call(t,n)&&(e[n]=t[n]);function a(){this.constructor=e}a.prototype=t.prototype,e.prototype=new a,e.__super__=t.prototype})(a,Error),a.prototype.toString=function(){return null!=this.parsedLine&&null!=this.snippet?" "+this.message+" (line "+this.parsedLine+": '"+this.snippet+"')":" "+this.message},n=a,e.exports=n},function(e,t,n){"use strict";t.__esModule=!0,t.triggerEvents=void 0,t.getOffsetWH=function(e,t){var n="width";"left"!==t&&"right"!==t||(n="height");return e?e.getBoundingClientRect()[n]:0},t.getOffsetLT=function(e,t){var n="left";"left"!==t&&"right"!==t||(n="top");return e.getBoundingClientRect()[n]},t.isTransformSupported=function(e){return"transform"in e||"webkitTransform"in e||"MozTransform"in e},t.toArray=function(e){var n=[];return r.default.Children.forEach(e,function(e,t){r.default.isValidElement(e)&&n.push(r.default.cloneElement(e,{key:e.key||t}))}),n};var a,o=n(0),r=(a=o)&&a.__esModule?a:{default:a};t.triggerEvents={CLICK:"click",HOVER:"hover"}},function(e,t,n){"use strict";t.__esModule=!0;var a,o=n(13),i=(a=o)&&a.__esModule?a:{default:a};t.default=function(e,t){var n=e.listType,a=e.defaultFileList,o=e.fileList,r=(0,i.default)(e,["listType","defaultFileList","fileList"]);return"text-image"===n?(t("listType=text-image","listType=image","Upload"),r.listType="image"):"picture-card"===n?(t("listType=picture-card","listType=card","Upload"),r.listType="card"):r.listType=n,"defaultFileList"in e&&(t("defaultFileList","defaultValue","Upload"),r.defaultValue=a),"fileList"in e&&(t("fileList","value","Upload"),r.value=o),r},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var i=r(n(4)),s=r(n(6)),a=r(n(7)),o=n(0);function r(e){return e&&e.__esModule?e:{default:e}}var l,u=(l=o.Component,(0,a.default)(c,l),c.prototype.abort=function(e){this.uploaderRef.abort(e)},c.prototype.startUpload=function(){this.uploaderRef.startUpload()},c.prototype.isUploading=function(){return this.uploaderRef.isUploading()},c);function c(){var e,t,n;(0,i.default)(this,c);for(var a=arguments.length,o=Array(a),r=0;re.slidesToShow&&(t=e.slideWidth*e.slidesToShow*-1,o=e.slideHeight*e.slidesToShow*-1),e.slideCount%e.slidesToScroll!=0){var r=e.slideIndex+e.slidesToScroll>e.slideCount&&e.slideCount>e.slidesToShow;if(e.rtl)r=(e.slideIndex>=e.slideCount?e.slideCount-e.slideIndex:e.slideIndex)+e.slidesToScroll>e.slideCount&&e.slideCount>e.slidesToShow;r&&(o=e.slideIndex>e.slideCount?(t=(e.slidesToShow-(e.slideIndex-e.slideCount))*e.slideWidth*-1,(e.slidesToShow-(e.slideIndex-e.slideCount))*e.slideHeight*-1):(t=e.slideCount%e.slidesToScroll*e.slideWidth*-1,e.slideCount%e.slidesToScroll*e.slideHeight*-1))}}else e.slideCount%e.slidesToScroll!=0&&e.slideIndex+e.slidesToScroll>e.slideCount&&e.slideCount>e.slidesToShow&&(t=(e.slidesToShow-e.slideCount%e.slidesToScroll)*e.slideWidth);if(e.centerMode&&(e.infinite?t+=e.slideWidth*Math.floor(e.slidesToShow/2):t=e.slideWidth*Math.floor(e.slidesToShow/2)),n=e.vertical?e.slideIndex*e.slideHeight*-1+o:e.slideIndex*e.slideWidth*-1+t,!0===e.variableWidth){var i=void 0;n=(a=e.slideCount<=e.slidesToShow||!1===e.infinite?s.default.findDOMNode(e.trackRef).childNodes[e.slideIndex]:(i=e.slideIndex+e.slidesToShow,s.default.findDOMNode(e.trackRef).childNodes[i]))?-1*a.offsetLeft:0,!0===e.centerMode&&(a=!1===e.infinite?s.default.findDOMNode(e.trackRef).children[e.slideIndex]:s.default.findDOMNode(e.trackRef).children[e.slideIndex+e.slidesToShow+1])&&(n=-1*a.offsetLeft+(e.listWidth-a.offsetWidth)/2)}return n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.routerMiddleware=t.routerActions=t.goForward=t.goBack=t.go=t.replace=t.push=t.CALL_HISTORY_METHOD=t.routerReducer=t.LOCATION_CHANGE=t.syncHistoryWithStore=void 0;var a=n(303);Object.defineProperty(t,"LOCATION_CHANGE",{enumerable:!0,get:function(){return a.LOCATION_CHANGE}}),Object.defineProperty(t,"routerReducer",{enumerable:!0,get:function(){return a.routerReducer}});var o=n(304);Object.defineProperty(t,"CALL_HISTORY_METHOD",{enumerable:!0,get:function(){return o.CALL_HISTORY_METHOD}}),Object.defineProperty(t,"push",{enumerable:!0,get:function(){return o.push}}),Object.defineProperty(t,"replace",{enumerable:!0,get:function(){return o.replace}}),Object.defineProperty(t,"go",{enumerable:!0,get:function(){return o.go}}),Object.defineProperty(t,"goBack",{enumerable:!0,get:function(){return o.goBack}}),Object.defineProperty(t,"goForward",{enumerable:!0,get:function(){return o.goForward}}),Object.defineProperty(t,"routerActions",{enumerable:!0,get:function(){return o.routerActions}});var r=s(n(449)),i=s(n(450));function s(e){return e&&e.__esModule?e:{default:e}}t.syncHistoryWithStore=r.default,t.routerMiddleware=i.default},function(e,t,n){"use strict";function a(o){return function(e){var n=e.dispatch,a=e.getState;return function(t){return function(e){return"function"==typeof e?e(n,a,o):t(e)}}}}var o=a();o.withExtraArgument=a,t.a=o},function(e,t,n){"use strict";var a=n(150),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},d={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},i={};function p(e){return a.isMemo(e)?r:i[e.$$typeof]||o}i[a.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var f=Object.defineProperty,h=Object.getOwnPropertyNames,m=Object.getOwnPropertySymbols,g=Object.getOwnPropertyDescriptor,y=Object.getPrototypeOf,_=Object.prototype;e.exports=function e(t,n,a){if("string"==typeof n)return t;if(_){var o=y(n);o&&o!==_&&e(t,o,a)}var r=h(n);m&&(r=r.concat(m(n)));for(var i=p(t),s=p(n),l=0;l\n com.alibaba.nacos\n nacos-client\n ${version}\n \n*/\npackage com.alibaba.nacos.example;\n\nimport java.util.Properties;\nimport java.util.concurrent.Executor;\nimport com.alibaba.nacos.api.NacosFactory;\nimport com.alibaba.nacos.api.config.ConfigService;\nimport com.alibaba.nacos.api.config.listener.Listener;\nimport com.alibaba.nacos.api.exception.NacosException;\n\n/**\n * Config service example\n * \n * @author Nacos\n *\n */\npublic class ConfigExample {\n\n\tpublic static void main(String[] args) throws NacosException, InterruptedException {\n\t\tString serverAddr = "localhost";\n\t\tString dataId = "'.concat(e.dataId,'";\n\t\tString group = "').concat(e.group,'";\n\t\tProperties properties = new Properties();\n\t\tproperties.put(PropertyKeyConst.SERVER_ADDR, serverAddr);\n\t\tConfigService configService = NacosFactory.createConfigService(properties);\n\t\tString content = configService.getConfig(dataId, group, 5000);\n\t\tSystem.out.println(content);\n\t\tconfigService.addListener(dataId, group, new Listener() {\n\t\t\t@Override\n\t\t\tpublic void receiveConfigInfo(String configInfo) {\n\t\t\t\tSystem.out.println("recieve:" + configInfo);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic Executor getExecutor() {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t});\n\t\t\n\t\tboolean isPublishOk = configService.publishConfig(dataId, group, "content");\n\t\tSystem.out.println(isPublishOk);\n\t\t\n\t\tThread.sleep(3000);\n\t\tcontent = configService.getConfig(dataId, group, 5000);\n\t\tSystem.out.println(content);\n\n\t\tboolean isRemoveOk = configService.removeConfig(dataId, group);\n\t\tSystem.out.println(isRemoveOk);\n\t\tThread.sleep(3000);\n\n\t\tcontent = configService.getConfig(dataId, group, 5000);\n\t\tSystem.out.println(content);\n\t\tThread.sleep(300000);\n\n\t}\n}\n')}},{key:"getNodejsCode",value:function(e){return"TODO"}},{key:"getCppCode",value:function(e){return"TODO"}},{key:"getShellCode",value:function(e){return"TODO"}},{key:"getPythonCode",value:function(e){return"TODO"}},{key:"openDialog",value:function(e){var t=this;this.setState({dialogvisible:!0}),this.record=e,setTimeout(function(){t.getData()})}},{key:"closeDialog",value:function(){this.setState({dialogvisible:!1})}},{key:"createCodeMirror",value:function(e,t){var n=this.refs.codepreview;n&&(n.innerHTML="",this.cm=window.CodeMirror(n,{value:t,mode:e,height:400,width:500,lineNumbers:!0,theme:"xq-light",lint:!0,tabMode:"indent",autoMatchParens:!0,textWrapping:!0,gutters:["CodeMirror-lint-markers"],extraKeys:{F1:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)}}}))}},{key:"changeTab",value:function(e,t){var n=this;setTimeout(function(){n[e]=!0,n.createCodeMirror("text/javascript",t)})}},{key:"render",value:function(){var e=this.props.locale,t=void 0===e?{}:e,n=oe.a.createElement("div",null);return oe.a.createElement("div",null,oe.a.createElement(W.a,{title:t.sampleCode,style:{width:"80%"},visible:this.state.dialogvisible,footer:n,onClose:this.closeDialog.bind(this)},oe.a.createElement("div",{style:{height:500}},oe.a.createElement(g.a,{tip:t.loading,style:{width:"100%"},visible:this.state.loading},oe.a.createElement(de.a,{shape:"text",style:{height:40,paddingBottom:10}},oe.a.createElement(pe,{title:"Java",key:1,onClick:this.changeTab.bind(this,"commoneditor1",this.defaultCode)}),oe.a.createElement(pe,{title:"Spring Boot",key:2,onClick:this.changeTab.bind(this,"commoneditor2",this.sprigboot_code)}),oe.a.createElement(pe,{title:"Spring Cloud",key:21,onClick:this.changeTab.bind(this,"commoneditor21",this.sprigcloud_code)}),oe.a.createElement(pe,{title:"Node.js",key:3,onClick:this.changeTab.bind(this,"commoneditor3",this.nodejsCode)}),oe.a.createElement(pe,{title:"C++",key:4,onClick:this.changeTab.bind(this,"commoneditor4",this.cppCode)}),oe.a.createElement(pe,{title:"Shell",key:5,onClick:this.changeTab.bind(this,"commoneditor5",this.shellCode)}),oe.a.createElement(pe,{title:"Python",key:6,onClick:this.changeTab.bind(this,"commoneditor6",this.pythonCode)})),oe.a.createElement("div",{ref:"codepreview"})))))}}]),n}(oe.a.Component),o.displayName="ShowCodeing",a=r))||a,he=(n(629),ee.a.Row),me=ee.a.Col,ge=(0,X.a.config)((l=s=function(e){function n(e){var t;return Object(U.a)(this,n),(t=Object(q.a)(this,Object(G.a)(n).call(this,e))).state={visible:!1,title:"",content:"",isok:!0,dataId:"",group:""},t}return Object($.a)(n,e),Object(K.a)(n,[{key:"componentDidMount",value:function(){this.initData()}},{key:"initData",value:function(){var e=this.props.locale,t=void 0===e?{}:e;this.setState({title:t.confManagement})}},{key:"openDialog",value:function(e){this.setState({visible:!0,title:e.title,content:e.content,isok:e.isok,dataId:e.dataId,group:e.group,message:e.message})}},{key:"closeDialog",value:function(){this.setState({visible:!1})}},{key:"render",value:function(){var e=this.props.locale,t=void 0===e?{}:e,n=oe.a.createElement("div",{style:{textAlign:"right"}},oe.a.createElement(C.a,{type:"primary",onClick:this.closeDialog.bind(this)},t.determine));return oe.a.createElement("div",null,oe.a.createElement(W.a,{visible:this.state.visible,footer:n,style:{width:555},onCancel:this.closeDialog.bind(this),onClose:this.closeDialog.bind(this),title:t.deletetitle},oe.a.createElement("div",null,oe.a.createElement(he,null,oe.a.createElement(me,{span:"4",style:{paddingTop:16}},oe.a.createElement(R.a,{type:"".concat(this.state.isok?"success":"delete","-filling"),style:{color:this.state.isok?"green":"red"},size:"xl"})),oe.a.createElement(me,{span:"20"},oe.a.createElement("div",null,oe.a.createElement("h3",null,this.state.isok?t.deletedSuccessfully:t.deleteFailed),oe.a.createElement("p",null,oe.a.createElement("span",{style:{color:"#999",marginRight:5}},"Data ID:"),oe.a.createElement("span",{style:{color:"#c7254e"}},this.state.dataId)),oe.a.createElement("p",null,oe.a.createElement("span",{style:{color:"#999",marginRight:5}},"Group:"),oe.a.createElement("span",{style:{color:"#c7254e"}},this.state.group)),this.state.isok?"":oe.a.createElement("p",{style:{color:"red"}},this.state.message)))))))}}]),n}(oe.a.Component),s.displayName="DeleteDialog",i=l))||i,ye=(n(630),n(365)),_e=n.n(ye),ve=(0,X.a.config)((d=c=function(e){function t(){return Object(U.a)(this,t),Object(q.a)(this,Object(G.a)(t).apply(this,arguments))}return Object($.a)(t,e),Object(K.a)(t,[{key:"render",value:function(){var e=this.props,t=e.data,n=void 0===t?{}:t,a=e.height,o=e.locale,r=void 0===o?{}:o;return oe.a.createElement("div",null,"notice"===n.modeType?oe.a.createElement("div",{"data-spm-click":"gostr=/aliyun;locaid=notice"},oe.a.createElement(_e.a,{style:{marginBottom:1l?I.a.createElement($.a,{className:"pagination",total:s.count,pageSize:l,onChange:function(e){return a.onChangePage(e)}}):null,I.a.createElement(Z,{ref:this.editInstanceDialog,serviceName:r,clusterName:n,openLoading:function(){return a.openLoading()},closeLoading:function(){return a.closeLoading()},getInstanceList:function(){return a.getInstanceList()}})):null}}]),n}(I.a.Component),d.displayName="InstanceTable",c=p))||c,te=n(66),ne=(n(643),P.a.Item),ae={labelCol:{fixedSpan:10},wrapperCol:{span:14}},oe=(0,O.a.config)((m=h=function(e){function n(e){var t;return Object(C.a)(this,n),(t=Object(E.a)(this,Object(L.a)(n).call(this,e))).editServiceDialog=I.a.createRef(),t.editClusterDialog=I.a.createRef(),t.state={serviceName:a(e.location.search,"name"),groupName:a(e.location.search,"groupName"),loading:!1,currentPage:1,clusters:[],instances:{},service:{},pageSize:10,pageNum:{}},t}return Object(D.a)(n,e),Object(x.a)(n,[{key:"componentDidMount",value:function(){this.state.serviceName?this.getServiceDetail():this.props.history.goBack()}},{key:"getServiceDetail",value:function(){var r=this,e=this.state,t=e.serviceName,n=e.groupName;Object(A.c)({url:"v1/ns/catalog/service?serviceName=".concat(t,"&groupName=").concat(n),beforeSend:function(){return r.openLoading()},success:function(e){var t=e.clusters,n=void 0===t?[]:t,a=e.service,o=void 0===a?{}:a;return r.setState({service:o,clusters:n})},error:function(e){return T.a.error(e.responseText||"error")},complete:function(){return r.closeLoading()}})}},{key:"openLoading",value:function(){this.setState({loading:!0})}},{key:"closeLoading",value:function(){this.setState({loading:!1})}},{key:"openEditServiceDialog",value:function(){this.editServiceDialog.current.getInstance().show(this.state.service)}},{key:"openClusterDialog",value:function(e){this.editClusterDialog.current.getInstance().show(e)}},{key:"render",value:function(){var t=this,e=this.props.locale,n=void 0===e?{}:e,a=this.state,o=a.serviceName,r=a.groupName,i=a.loading,s=a.service,l=void 0===s?{}:s,u=a.clusters,c=l.metadata,d=void 0===c?{}:c,p=l.selector,f=void 0===p?{}:p,h="";return Object.keys(d).length&&(h=JSON.stringify(d,null,"\t")),I.a.createElement("div",{className:"main-container service-detail"},I.a.createElement(y.a,{shape:"flower",tip:"Loading...",className:"loading",visible:i,color:"#333"},I.a.createElement("h1",{style:{position:"relative",width:"100%"}},n.serviceDetails,I.a.createElement(w.a,{type:"primary",className:"header-btn",onClick:function(){return t.props.history.goBack()}},n.back),I.a.createElement(w.a,{type:"normal",className:"header-btn",onClick:function(){return t.openEditServiceDialog()}},n.editService)),I.a.createElement(P.a,ae,I.a.createElement(ne,{label:"".concat(n.serviceName,":")},I.a.createElement(S.a,{value:l.name,readOnly:!0})),I.a.createElement(ne,{label:"".concat(n.groupName,":")},I.a.createElement(S.a,{value:l.groupName,readOnly:!0})),I.a.createElement(ne,{label:"".concat(n.protectThreshold,":")},I.a.createElement(S.a,{value:l.protectThreshold,readOnly:!0})),I.a.createElement(ne,{label:"".concat(n.metadata,":")},I.a.createElement(q.a,{language:"json",width:"100%",height:200,value:h,options:K.c})),I.a.createElement(ne,{label:"".concat(n.type,":")},I.a.createElement(S.a,{value:f.type,readOnly:!0})),"label"===l.type&&I.a.createElement(ne,{label:"".concat(n.selector,":")},I.a.createElement(S.a,{value:f.selector,readOnly:!0}))),u.map(function(e){return I.a.createElement(v.a,{key:e.name,className:"cluster-card",title:"".concat(n.cluster,":"),subTitle:e.name,contentHeight:"auto",extra:I.a.createElement(w.a,{type:"normal",onClick:function(){return t.openClusterDialog(e)}},n.editCluster)},I.a.createElement(ee,{clusterName:e.name,serviceName:o,groupName:r}))})),I.a.createElement(R.a,{ref:this.editServiceDialog,openLoading:function(){return t.openLoading()},closeLoading:function(){return t.closeLoading()},getServiceDetail:function(){return t.getServiceDetail()}}),I.a.createElement(G,{ref:this.editClusterDialog,openLoading:function(){return t.openLoading()},closeLoading:function(){return t.closeLoading()},getServiceDetail:function(){return t.getServiceDetail()}}))}}]),n}(I.a.Component),h.displayName="ServiceDetail",f=m))||f;t.a=oe},function(e,t,n){"use strict";n(39);var a,o,r,i,s,l,u=n(26),y=n.n(u),c=(n(31),n(19)),_=n.n(c),d=(n(339),n(118)),v=n.n(d),p=(n(33),n(23)),b=n.n(p),f=(n(105),n(71)),M=n.n(f),h=(n(92),n(59)),w=n.n(h),m=(n(62),n(32)),k=n.n(m),g=(n(37),n(8)),S=n.n(g),T=(n(34),n(10)),C=n.n(T),x=(n(111),n(51)),E=n.n(x),L=n(56),D=n(27),N=(n(38),n(21)),O=n.n(N),Y=(n(44),n(24)),P=n.n(Y),j=n(14),I=n(15),A=n(16),R=n(17),H=n(18),F=(n(28),n(9)),z=n.n(F),W=(n(54),n(30)),B=n.n(W),V=n(0),U=n.n(V),K=n(1),q=n(65),G=n(119),J=n(85),$=(n(589),B.a.Row),Q=B.a.Col,X=(0,z.a.config)((r=o=function(e){function n(e){var t;return Object(j.a)(this,n),(t=Object(A.a)(this,Object(R.a)(n).call(this,e))).diffeditor=U.a.createRef(),t.state={dialogvisible:!1},t}return Object(H.a)(n,e),Object(I.a)(n,[{key:"openDialog",value:function(e,t){var n=this;this.setState({dialogvisible:!0}),setTimeout(function(){n.createDiffCodeMirror(e,t)})}},{key:"closeDialog",value:function(){this.setState({dialogvisible:!1})}},{key:"createDiffCodeMirror",value:function(e,t){var n=this.diffeditor.current;n.innerHTML="",this.diffeditor=window.CodeMirror.MergeView(n,{value:e||"",readOnly:!0,origLeft:null,orig:t||"",lineNumbers:!0,mode:this.mode,theme:"xq-light",highlightDifferences:!0,connect:"align",collapseIdentical:!1})}},{key:"confirmPub",value:function(){this.closeDialog(),this.props.publishConfig()}},{key:"render",value:function(){var e=this.props.locale,t=void 0===e?{}:e,n=U.a.createElement("div",null," ",U.a.createElement(_.a,{type:"primary",onClick:this.confirmPub.bind(this)},t.publish));return U.a.createElement("div",null,U.a.createElement(O.a,{title:t.contents,style:{width:"80%"},visible:this.state.dialogvisible,footer:n,onClose:this.closeDialog.bind(this)},U.a.createElement("div",{style:{height:400}},U.a.createElement("div",null,U.a.createElement($,null,U.a.createElement(Q,{style:{textAlign:"center"}},t.currentArea),U.a.createElement(Q,{style:{textAlign:"center"}},t.originalValue))),U.a.createElement("div",{style:{clear:"both",height:480},ref:this.diffeditor}))))}}]),n}(U.a.Component),o.displayName="DiffEditorDialog",a=r))||a,Z=(n(590),n(591),B.a.Row),ee=B.a.Col,te=[{value:"text",label:"TEXT"},{value:"json",label:"JSON"},{value:"xml",label:"XML"},{value:"yaml",label:"YAML"},{value:"html",label:"HTML"},{value:"properties",label:"Properties"}],ne=["production","beta"],ae=(0,z.a.config)((l=s=function(e){function n(e){var t;return Object(j.a)(this,n),(t=Object(A.a)(this,Object(R.a)(n).call(this,e))).state={loading:!1,isBeta:!1,isNewConfig:!0,betaPublishSuccess:!1,betaIps:"",tabActiveKey:"",form:{dataId:"",group:"",content:"",appName:"",desc:"",config_tags:[],type:"text"},tagDataSource:[],openAdvancedSettings:!1},t.successDialog=U.a.createRef(),t.diffEditorDialog=U.a.createRef(),t}return Object(H.a)(n,e),Object(I.a)(n,[{key:"componentDidMount",value:function(){var t=this,e=!Object(K.b)("dataId"),n=Object(K.b)("group").trim();this.setState({isNewConfig:e},function(){e?(n&&t.setState({group:n}),t.initMoacoEditor("text","")):t.changeForm({dataId:Object(K.b)("dataId").trim(),group:n},function(){return t.getConfig(!0).then(function(e){e?t.setState({isBeta:!0,tabActiveKey:"beta",betaPublishSuccess:!0}):t.getConfig()})})})}},{key:"initMoacoEditor",value:function(e,t){var n=this,a=document.getElementById("container");a.innerHTML="";var o={value:t,language:e,codeLens:!(this.monacoEditor=null),selectOnLineNumbers:!0,roundedSelection:!1,readOnly:!1,lineNumbersMinChars:!0,theme:"vs-dark",wordWrapColumn:120,folding:!1,showFoldingControls:"always",wordWrap:"wordWrapColumn",cursorStyle:"line",automaticLayout:!0};window.monaco?this.monacoEditor=window.monaco.editor.create(a,o):window.importEditor(function(){n.monacoEditor=window.monaco.editor.create(a,o)})}},{key:"createDiffCodeMirror",value:function(e,t){var n=this.diffEditorDialog.current.getInstance();n.innerHTML="",this.diffeditor=window.CodeMirror.MergeView(n,{value:e||"",origLeft:null,orig:t||"",lineNumbers:!0,mode:this.mode,theme:"xq-light",highlightDifferences:!0,connect:"align",collapseIdentical:!1})}},{key:"openDiff",value:function(e){this.diffcb=e;var t=this.monacoEditor.getValue(),n=this.codeVal||"";t=t.replace(/\r\n/g,"\n").replace(/\n/g,"\r\n"),n=n.replace(/\r\n/g,"\n").replace(/\n/g,"\r\n"),this.diffEditorDialog.current.getInstance().openDialog(t,n)}},{key:"clickTab",value:function(e){var t=this;console.log("tabActiveKey",e,"beta"===e),this.setState({tabActiveKey:e},function(){return t.getConfig("beta"===e)})}},{key:"getCodeVal",value:function(){var e=this.props.locale,t=void 0===e?{}:e,n=this.state.form,a=(n.type,n.content),o=this.monacoEditor?this.monacoEditor.getValue():a;return o||(P.a.error({content:t.submitFailed,align:"cc cc"}),!1)}},{key:"publish",value:function(){var n=this,e=this.props.locale,a=void 0===e?{}:e,t=this.state.form.type;this.state.isNewConfig&&this.validation();var o=this.getCodeVal();if(o)return G.a.validate({content:o,type:t})?this._publishConfig():new Promise(function(e,t){O.a.confirm({content:a.codeValErrorPrompt,onOk:function(){return e(n._publishConfig())},onCancel:function(){return e(!1)}})})}},{key:"_publishConfig",value:function(e){var t=this,n=0\n com.alibaba.nacos\n nacos-client\n ${latest.version}\n \n*/\npackage com.alibaba.nacos.example;\n\nimport java.util.Properties;\n\nimport com.alibaba.nacos.api.exception.NacosException;\nimport com.alibaba.nacos.api.naming.NamingFactory;\nimport com.alibaba.nacos.api.naming.NamingService;\nimport com.alibaba.nacos.api.naming.listener.Event;\nimport com.alibaba.nacos.api.naming.listener.EventListener;\nimport com.alibaba.nacos.api.naming.listener.NamingEvent;\n\n/**\n * @author nkorange\n */\npublic class NamingExample {\n\n public static void main(String[] args) throws NacosException {\n\n Properties properties = new Properties();\n properties.setProperty("serverAddr", System.getProperty("serverAddr"));\n properties.setProperty("namespace", System.getProperty("namespace"));\n\n NamingService naming = NamingFactory.createNamingService(properties);\n\n naming.registerInstance("'.concat(this.record.name,'", "11.11.11.11", 8888, "TEST1");\n\n naming.registerInstance("').concat(this.record.name,'", "2.2.2.2", 9999, "DEFAULT");\n\n System.out.println(naming.getAllInstances("').concat(this.record.name,'"));\n\n naming.deregisterInstance("').concat(this.record.name,'", "2.2.2.2", 9999, "DEFAULT");\n\n System.out.println(naming.getAllInstances("').concat(this.record.name,'"));\n\n naming.subscribe("').concat(this.record.name,'", new EventListener() {\n @Override\n public void onEvent(Event event) {\n System.out.println(((NamingEvent)event).getServiceName());\n System.out.println(((NamingEvent)event).getInstances());\n }\n });\n }\n}')}},{key:"getSpringCode",value:function(e){return'/* Refer to document: https://github.com/nacos-group/nacos-examples/tree/master/nacos-spring-example/nacos-spring-discovery-example\n* pom.xml\n \n com.alibaba.nacos\n nacos-spring-context\n ${latest.version}\n \n*/\n\n// Refer to document: https://github.com/nacos-group/nacos-examples/blob/master/nacos-spring-example/nacos-spring-discovery-example/src/main/java/com/alibaba/nacos/example/spring\npackage com.alibaba.nacos.example.spring;\n\nimport com.alibaba.nacos.api.annotation.NacosProperties;\nimport com.alibaba.nacos.spring.context.annotation.discovery.EnableNacosDiscovery;\nimport org.springframework.context.annotation.Configuration;\n\n@Configuration\n@EnableNacosDiscovery(globalProperties = @NacosProperties(serverAddr = "127.0.0.1:8848"))\npublic class NacosConfiguration {\n\n}\n\n// Refer to document: https://github.com/nacos-group/nacos-examples/tree/master/nacos-spring-example/nacos-spring-discovery-example/src/main/java/com/alibaba/nacos/example/spring/controller\npackage com.alibaba.nacos.example.spring.controller;\n\nimport com.alibaba.nacos.api.annotation.NacosInjected;\nimport com.alibaba.nacos.api.exception.NacosException;\nimport com.alibaba.nacos.api.naming.NamingService;\nimport com.alibaba.nacos.api.naming.pojo.Instance;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\nimport org.springframework.web.bind.annotation.ResponseBody;\n\nimport java.util.List;\n\nimport static org.springframework.web.bind.annotation.RequestMethod.GET;\n\n@Controller\n@RequestMapping("discovery")\npublic class DiscoveryController {\n\n @NacosInjected\n private NamingService namingService;\n\n @RequestMapping(value = "/get", method = GET)\n @ResponseBody\n public List get(@RequestParam String serviceName) throws NacosException {\n return namingService.getAllInstances(serviceName);\n }\n}'}},{key:"getSpringBootCode",value:function(e){return'/* Refer to document: https://github.com/nacos-group/nacos-examples/blob/master/nacos-spring-boot-example/nacos-spring-boot-discovery-example\n* pom.xml\n \n com.alibaba.boot\n nacos-discovery-spring-boot-starter\n ${latest.version}\n \n*/\n/* Refer to document: https://github.com/nacos-group/nacos-examples/blob/master/nacos-spring-boot-example/nacos-spring-boot-discovery-example/src/main/resources\n* application.properties\n nacos.discovery.server-addr=127.0.0.1:8848\n*/ \n// Refer to document: https://github.com/nacos-group/nacos-examples/blob/master/nacos-spring-boot-example/nacos-spring-boot-discovery-example/src/main/java/com/alibaba/nacos/example/spring/boot/controller\n\npackage com.alibaba.nacos.example.spring.boot.controller;\n\nimport com.alibaba.nacos.api.annotation.NacosInjected;\nimport com.alibaba.nacos.api.exception.NacosException;\nimport com.alibaba.nacos.api.naming.NamingService;\nimport com.alibaba.nacos.api.naming.pojo.Instance;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestParam;\nimport org.springframework.web.bind.annotation.ResponseBody;\n\nimport java.util.List;\n\nimport static org.springframework.web.bind.annotation.RequestMethod.GET;\n\n@Controller\n@RequestMapping("discovery")\npublic class DiscoveryController {\n\n @NacosInjected\n private NamingService namingService;\n\n @RequestMapping(value = "/get", method = GET)\n @ResponseBody\n public List get(@RequestParam String serviceName) throws NacosException {\n return namingService.getAllInstances(serviceName);\n }\n}'}},{key:"getSpringCloudCode",value:function(e){return"/* Refer to document: https://github.com/nacos-group/nacos-examples/blob/master/nacos-spring-cloud-example/nacos-spring-cloud-discovery-example/\n* pom.xml \n \n org.springframework.cloud\n spring-cloud-starter-alibaba-nacos-discovery\n ${latest.version}\n \n*/\n\n// nacos-spring-cloud-provider-example\n\n/* Refer to document: https://github.com/nacos-group/nacos-examples/tree/master/nacos-spring-cloud-example/nacos-spring-cloud-discovery-example/nacos-spring-cloud-provider-example/src/main/resources\n* application.properties\nserver.port=18080\nspring.application.name=".concat(this.record.name,'\nspring.cloud.nacos.discovery.server-addr=127.0.0.1:8848\n*/ \n\n// Refer to document: https://github.com/nacos-group/nacos-examples/tree/master/nacos-spring-cloud-example/nacos-spring-cloud-discovery-example/nacos-spring-cloud-provider-example/src/main/java/com/alibaba/nacos/example/spring/cloud\npackage com.alibaba.nacos.example.spring.cloud;\n\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\nimport org.springframework.cloud.client.discovery.EnableDiscoveryClient;\nimport org.springframework.web.bind.annotation.PathVariable;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestMethod;\nimport org.springframework.web.bind.annotation.RestController;\n\n/**\n * @author xiaojing\n */\n@SpringBootApplication\n@EnableDiscoveryClient \npublic class NacosProviderApplication {\n\n public static void main(String[] args) {\n SpringApplication.run(NacosProviderApplication.class, args);\n}\n\n @RestController\n class EchoController {\n @RequestMapping(value = "/echo/{string}", method = RequestMethod.GET)\n public String echo(@PathVariable String string) {\n return "Hello Nacos Discovery " + string;\n }\n }\n}\n\n// nacos-spring-cloud-consumer-example\n\n/* Refer to document: https://github.com/nacos-group/nacos-examples/tree/master/nacos-spring-cloud-example/nacos-spring-cloud-discovery-example/nacos-spring-cloud-consumer-example/src/main/resources\n* application.properties\nspring.application.name=micro-service-oauth2\nspring.cloud.nacos.discovery.server-addr=127.0.0.1:8848\n*/ \n\n// Refer to document: https://github.com/nacos-group/nacos-examples/tree/master/nacos-spring-cloud-example/nacos-spring-cloud-discovery-example/nacos-spring-cloud-consumer-example/src/main/java/com/alibaba/nacos/example/spring/cloud\npackage com.alibaba.nacos.example.spring.cloud;\n\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\nimport org.springframework.cloud.client.discovery.EnableDiscoveryClient;\nimport org.springframework.cloud.client.loadbalancer.LoadBalanced;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.web.bind.annotation.PathVariable;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.RequestMethod;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.client.RestTemplate;\n\n/**\n * @author xiaojing\n */\n@SpringBootApplication\n@EnableDiscoveryClient\npublic class NacosConsumerApplication {\n\n @LoadBalanced\n @Bean\n public RestTemplate restTemplate() {\n return new RestTemplate();\n }\n\n public static void main(String[] args) {\n SpringApplication.run(NacosConsumerApplication.class, args);\n }\n\n @RestController\n public class TestController {\n\n private final RestTemplate restTemplate;\n\n @Autowired\n public TestController(RestTemplate restTemplate) {this.restTemplate = restTemplate;}\n\n @RequestMapping(value = "/echo/{str}", method = RequestMethod.GET)\n public String echo(@PathVariable String str) {\n return restTemplate.getForObject("http://service-provider/echo/" + str, String.class);\n }\n }\n}')}},{key:"getNodejsCode",value:function(e){return"TODO"}},{key:"getCppCode",value:function(e){return"TODO"}},{key:"getShellCode",value:function(e){return"TODO"}},{key:"getPythonCode",value:function(e){return"TODO"}},{key:"openDialog",value:function(e){var t=this;this.setState({dialogvisible:!0}),this.record=e,setTimeout(function(){t.getData()})}},{key:"closeDialog",value:function(){this.setState({dialogvisible:!1})}},{key:"createCodeMirror",value:function(e,t){var n=this.refs.codepreview;n&&(n.innerHTML="",this.cm=window.CodeMirror(n,{value:t,mode:e,height:400,width:500,lineNumbers:!0,theme:"xq-light",lint:!0,tabMode:"indent",autoMatchParens:!0,textWrapping:!0,gutters:["CodeMirror-lint-markers"],extraKeys:{F1:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)}}}),this.cm.setSize("auto","490px"))}},{key:"changeTab",value:function(e,t){var n=this;setTimeout(function(){n[e]=!0,n.createCodeMirror("text/javascript",t)})}},{key:"render",value:function(){var e=this.props.locale,t=void 0===e?{}:e,n=z.a.createElement("div",null);return z.a.createElement("div",null,z.a.createElement(y.a,{title:t.sampleCode,style:{width:"80%"},visible:this.state.dialogvisible,footer:n,onClose:this.closeDialog.bind(this)},z.a.createElement("div",{style:{height:500}},z.a.createElement(S.a,{tip:t.loading,style:{width:"100%"},visible:this.state.loading},z.a.createElement(K.a,{shape:"text",style:{height:40,paddingBottom:10}},z.a.createElement(q,{title:"Java",key:0,onClick:this.changeTab.bind(this,"commoneditor1",this.defaultCode)}),z.a.createElement(q,{title:"Spring",key:1,onClick:this.changeTab.bind(this,"commoneditor1",this.springCode)}),z.a.createElement(q,{title:"Spring Boot",key:2,onClick:this.changeTab.bind(this,"commoneditor2",this.sprigbootCode)}),z.a.createElement(q,{title:"Spring Cloud",key:21,onClick:this.changeTab.bind(this,"commoneditor21",this.sprigcloudCode)}),z.a.createElement(q,{title:"Node.js",key:3,onClick:this.changeTab.bind(this,"commoneditor3",this.nodejsCode)}),z.a.createElement(q,{title:"C++",key:4,onClick:this.changeTab.bind(this,"commoneditor4",this.cppCode)}),z.a.createElement(q,{title:"Shell",key:5,onClick:this.changeTab.bind(this,"commoneditor5",this.shellCode)}),z.a.createElement(q,{title:"Python",key:6,onClick:this.changeTab.bind(this,"commoneditor6",this.pythonCode)})),z.a.createElement("div",{ref:"codepreview"})))))}}]),n}(z.a.Component),o.displayName="ShowServiceCodeing",a=r))||a,J=(n(642),H.a.Item),$=A.a.Row,Q=A.a.Col,X=j.a.Column,Z=(0,Y.a.config)((l=s=function(e){function t(e){var n;return Object(b.a)(this,t),(n=Object(w.a)(this,Object(k.a)(t).call(this,e))).getQueryLater=function(){setTimeout(function(){return n.queryServiceList()})},n.showcode=function(){setTimeout(function(){return n.queryServiceList()})},n.setNowNameSpace=function(e,t){return n.setState({nowNamespaceName:e,nowNamespaceId:t})},n.rowColor=function(e){return{className:e.healthyInstanceCount?"":"row-bg-red"}},n.editServiceDialog=z.a.createRef(),n.showcode=z.a.createRef(),n.state={loading:!1,total:0,pageSize:10,currentPage:1,dataSource:[],search:{serviceName:"",groupName:""},hasIpCount:!("false"===localStorage.getItem("hasIpCount"))},n.field=new v.a(Object(D.a)(n)),n}return Object(N.a)(t,e),Object(M.a)(t,[{key:"openLoading",value:function(){this.setState({loading:!0})}},{key:"closeLoading",value:function(){this.setState({loading:!1})}},{key:"openEditServiceDialog",value:function(){try{this.editServiceDialog.current.getInstance().show(this.state.service)}catch(e){}}},{key:"queryServiceList",value:function(){var i=this,e=this.state,t=e.currentPage,n=e.pageSize,a=e.search,o=e.withInstances,r=void 0!==o&&o,s=e.hasIpCount,l=["hasIpCount=".concat(s),"withInstances=".concat(r),"pageNo=".concat(t),"pageSize=".concat(n),"serviceNameParam=".concat(a.serviceName),"groupNameParam=".concat(a.groupName)];Object(W.c)({url:"v1/ns/catalog/services?".concat(l.join("&")),beforeSend:function(){return i.openLoading()},success:function(e){var t=0this.state.pageSize&&z.a.createElement("div",{style:{marginTop:10,textAlign:"right"}},z.a.createElement(T.a,{current:this.state.currentPage,total:this.state.total,pageSize:this.state.pageSize,onChange:function(e){return a.setState({currentPage:e},function(){return a.queryServiceList()})}}))),z.a.createElement(G,{ref:this.showcode}),z.a.createElement(V.a,{ref:this.editServiceDialog,openLoading:function(){return a.openLoading()},closeLoading:function(){return a.closeLoading()},queryServiceList:function(){return a.setState({currentPage:1},function(){return a.queryServiceList()})}}))}}]),t}(z.a.Component),s.displayName="ServiceList",i=l))||i;t.a=Z},function(e,t,n){"use strict";n(31);var a,o,r,i=n(19),s=n.n(i),l=(n(34),n(10)),u=n.n(l),c=(n(38),n(21)),d=n.n(c),p=(n(42),n(29)),f=n.n(p),h=n(14),m=n(15),g=n(16),y=n(17),_=n(22),v=n(18),b=(n(28),n(9)),M=n.n(b),w=(n(37),n(8)),k=n.n(w),S=n(0),T=n.n(S),C=n(1),x=(n(598),k.a.Item),E=(0,M.a.config)((r=o=function(e){function n(e){var t;return Object(h.a)(this,n),(t=Object(g.a)(this,Object(y.a)(n).call(this,e))).field=new f.a(Object(_.a)(t)),t.dataId=Object(C.b)("dataId")||"yanlin",t.group=Object(C.b)("group")||"DEFAULT_GROUP",t.serverId=Object(C.b)("serverId")||"center",t.nid=Object(C.b)("nid")||"",t.state={envName:"",visible:!1,showmore:!1},t}return Object(v.a)(n,e),Object(m.a)(n,[{key:"componentDidMount",value:function(){var e=this.props.locale,t=void 0===e?{}:e;this.typeMap={U:"publish",I:t.rollbackDelete,D:"publish"},this.typeMapName={U:t.update,I:t.insert,D:t.rollbackDelete},this.getDataDetail()}},{key:"toggleMore",value:function(){this.setState({showmore:!this.state.showmore})}},{key:"getDataDetail",value:function(){var a=this;this.tenant=Object(C.b)("namespace")||"",this.serverId=Object(C.b)("serverId")||"center";var e="v1/cs/history?dataId=".concat(this.dataId,"&group=").concat(this.group,"&nid=").concat(this.nid);Object(C.c)({url:e,success:function(e){if(null!=e){var t=e,n=a.serverId;a.id=t.id,a.field.setValue("dataId",t.dataId),a.field.setValue("content",t.content),a.field.setValue("appName",t.appName),a.field.setValue("opType",a.typeMapName[t.opType.trim()]),a.opType=t.opType,a.field.setValue("group",t.group),a.field.setValue("md5",t.md5),a.field.setValue("envName",n),a.setState({envName:n})}}})}},{key:"goList",value:function(){var e=Object(C.b)("namespace");this.props.history.push("/historyRollback?serverId=".concat(this.serverId,"&group=").concat(this.group,"&dataId=").concat(this.dataId,"&namespace=").concat(e))}},{key:"onOpenConfirm",value:function(){var e=this.props.locale,n=void 0===e?{}:e,a=this,o="post";"I"===this.opType.trim()&&(o="delete"),d.a.confirm({title:n.rollBack,content:T.a.createElement("div",{style:{marginTop:"-20px"}},T.a.createElement("h3",null,n.determine," ",n.followingConfiguration),T.a.createElement("p",null,T.a.createElement("span",{style:{color:"#999",marginRight:5}},"Data ID:"),T.a.createElement("span",{style:{color:"#c7254e"}},a.field.getValue("dataId"))),T.a.createElement("p",null,T.a.createElement("span",{style:{color:"#999",marginRight:5}},"Group:"),T.a.createElement("span",{style:{color:"#c7254e"}},a.field.getValue("group")))),onOk:function(){a.tenant=Object(C.b)("namespace")||"",a.serverId=Object(C.b)("serverId")||"center",a.dataId=a.field.getValue("dataId"),a.group=a.field.getValue("group");var e={appName:a.field.getValue("appName"),dataId:a.dataId,group:a.group,content:a.field.getValue("content"),tenant:a.tenant},t="v1/cs/configs";"I"===a.opType.trim()&&(t="v1/cs/configs?dataId=".concat(a.dataId,"&group=").concat(a.group),e={}),Object(C.c)({type:o,contentType:"application/x-www-form-urlencoded",url:t,data:e,success:function(e){!0===e&&d.a.alert({content:n.rollbackSuccessful})}})}})}},{key:"render",value:function(){var e=this.props.locale,t=void 0===e?{}:e,n=this.field.init,a={labelCol:{fixedSpan:6},wrapperCol:{span:18}};return T.a.createElement("div",{style:{padding:10}},T.a.createElement("h1",null,t.configurationRollback),T.a.createElement(k.a,{field:this.field},T.a.createElement(x,Object.assign({label:"Data ID:",required:!0},a),T.a.createElement(u.a,Object.assign({htmlType:"text",readOnly:!0},n("dataId"))),T.a.createElement("div",{style:{marginTop:10}},T.a.createElement("a",{style:{fontSize:"12px"},onClick:this.toggleMore.bind(this)},this.state.showmore?t.collapse:t.more))),T.a.createElement("div",{style:{overflow:"hidden",height:this.state.showmore?"auto":"0"}},T.a.createElement(x,Object.assign({label:"Group:",required:!0},a),T.a.createElement(u.a,Object.assign({htmlType:"text",readOnly:!0},n("group")))),T.a.createElement(x,Object.assign({label:t.home},a),T.a.createElement(u.a,Object.assign({htmlType:"text",readOnly:!0},n("appName"))))),T.a.createElement(x,Object.assign({label:t.actionType,required:!0},a),T.a.createElement(u.a,Object.assign({htmlType:"text",readOnly:!0},n("opType")))),T.a.createElement(x,Object.assign({label:"MD5:",required:!0},a),T.a.createElement(u.a,Object.assign({htmlType:"text",readOnly:!0},n("md5")))),T.a.createElement(x,Object.assign({label:t.configuration,required:!0},a),T.a.createElement(u.a.TextArea,Object.assign({htmlType:"text",multiple:!0,rows:15,readOnly:!0},n("content")))),T.a.createElement(x,Object.assign({label:" "},a),T.a.createElement(s.a,{type:"primary",style:{marginRight:10},onClick:this.onOpenConfirm.bind(this)},t.rollBack),T.a.createElement(s.a,{type:"normal",onClick:this.goList.bind(this)},t.back))))}}]),n}(T.a.Component),o.displayName="ConfigRollback",a=r))||a;t.a=E},function(e,t,n){"use strict";n(39);var a,o,r,i=n(26),s=n.n(i),l=(n(31),n(19)),u=n.n(l),c=(n(34),n(10)),d=n.n(c),p=(n(38),n(21)),f=n.n(p),h=(n(42),n(29)),m=n.n(h),g=n(14),y=n(15),_=n(16),v=n(17),b=n(22),M=n(18),w=(n(28),n(9)),k=n.n(w),S=(n(37),n(8)),T=n.n(S),C=(n(111),n(51)),x=n.n(C),E=n(0),L=n.n(E),D=n(1),N=(n(588),x.a.Item),O=T.a.Item,Y=(0,k.a.config)((r=o=function(e){function n(e){var t;return Object(g.a)(this,n),(t=Object(_.a)(this,Object(v.a)(n).call(this,e))).state={loading:!1,showmore:!1,activeKey:"normal",hasbeta:!1,ips:"",checkedBeta:!1,switchEncrypt:!1,tag:[]},t.field=new m.a(Object(b.a)(t)),t.dataId=Object(D.b)("dataId")||"yanlin",t.group=Object(D.b)("group")||"DEFAULT_GROUP",t.ips="",t.valueMap={},t.tenant=Object(D.b)("namespace")||"",t.searchDataId=Object(D.b)("searchDataId")||"",t.searchGroup=Object(D.b)("searchGroup")||"",t}return Object(M.a)(n,e),Object(y.a)(n,[{key:"componentDidMount",value:function(){this.initData(),this.getDataDetail()}},{key:"initData",value:function(){var e=this.props.locale,t=void 0===e?{}:e;this.dataId.startsWith("cipher-")&&this.setState({switchEncrypt:!0}),this.setState({tag:[{title:t.official,key:"normal"}]})}},{key:"openLoading",value:function(){this.setState({loading:!0})}},{key:"closeLoading",value:function(){this.setState({loading:!1})}},{key:"changeTab",value:function(e){var t=e.split("-")[0],n=this.valueMap[t];this.setState({activeKey:e}),this.field.setValue("content",n.content),n.betaIps&&this.setState({ips:n.betaIps})}},{key:"toggleMore",value:function(){this.setState({showmore:!this.state.showmore})}},{key:"getDataDetail",value:function(){var e=this.props.locale,n=void 0===e?{}:e,a=this;this.serverId=Object(D.b)("serverId")||"center",this.tenant=Object(D.b)("namespace")||"",this.edasAppName=Object(D.b)("edasAppName")||"",this.inApp=this.edasAppName;var t="v1/cs/configs?show=all&dataId=".concat(this.dataId,"&group=").concat(this.group);Object(D.c)({url:t,beforeSend:function(){a.openLoading()},success:function(e){if(null!=e){var t=e;a.valueMap.normal=t,a.field.setValue("dataId",t.dataId),a.field.setValue("content",t.content),a.field.setValue("appName",a.inApp?a.edasAppName:t.appName),a.field.setValue("envs",a.serverId),a.field.setValue("group",t.group),a.field.setValue("config_tags",t.configTags),a.field.setValue("desc",t.desc),a.field.setValue("md5",t.md5)}else f.a.alert({title:n.error,content:e.message})},complete:function(){a.closeLoading()}})}},{key:"goList",value:function(){this.props.history.push("/configurationManagement?serverId=".concat(this.serverId,"&group=").concat(this.searchGroup,"&dataId=").concat(this.searchDataId,"&namespace=").concat(this.tenant))}},{key:"render",value:function(){var e=this.props.locale,t=void 0===e?{}:e,n=this.field.init,a={labelCol:{span:2},wrapperCol:{span:22}},o=this.state.activeKey.split("-")[0];return L.a.createElement("div",{style:{padding:10}},L.a.createElement(s.a,{shape:"flower",tip:"Loading...",style:{width:"100%",position:"relative"},visible:this.state.loading,color:"#333"},L.a.createElement("h1",{style:{position:"relative",width:"100%"}},t.configurationDetails),this.state.hasbeta?L.a.createElement("div",{style:{display:"inline-block",height:40,width:"80%",overflow:"hidden"}},L.a.createElement(x.a,{shape:"wrapped",onChange:this.changeTab.bind(this),lazyLoad:!1,activeKey:this.state.activeKey},this.state.tag.map(function(e){return L.a.createElement(N,{title:e.title,key:e.key})}))):"",L.a.createElement(T.a,{inline:!1,field:this.field},L.a.createElement(O,Object.assign({label:"Data ID:",required:!0},a),L.a.createElement(d.a,Object.assign({htmlType:"text",readOnly:!0},n("dataId")))),L.a.createElement(O,Object.assign({label:"Group:",required:!0},a),L.a.createElement(d.a,Object.assign({htmlType:"text",readOnly:!0},n("group")))),L.a.createElement("div",{style:{marginTop:10}},L.a.createElement("a",{style:{fontSize:"12px"},onClick:this.toggleMore.bind(this)},this.state.showmore?t.collapse:t.more)),this.state.showmore?L.a.createElement("div",null,L.a.createElement(O,Object.assign({label:t.home},a),L.a.createElement(d.a,Object.assign({htmlType:"text",readOnly:!0},n("appName")))),L.a.createElement(O,Object.assign({label:t.tags},a),L.a.createElement(d.a,Object.assign({htmlType:"text",readOnly:!0},n("config_tags"))))):"",L.a.createElement(O,Object.assign({label:t.description},a),L.a.createElement(d.a.TextArea,Object.assign({htmlType:"text",multiple:!0,rows:3,readOnly:!0},n("desc")))),"normal"===o?"":L.a.createElement(O,Object.assign({label:t.betaRelease},a),L.a.createElement("div",{style:{width:"100%"},id:"betaips"},L.a.createElement(d.a.TextArea,{multiple:!0,style:{width:"100%"},value:this.state.ips,readOnly:!0,placeholder:"127.0.0.1,127.0.0.2"}))),L.a.createElement(O,Object.assign({label:"MD5:",required:!0},a),L.a.createElement(d.a,Object.assign({htmlType:"text",readOnly:!0},n("md5")))),L.a.createElement(O,Object.assign({label:t.configuration,required:!0},a),L.a.createElement(d.a.TextArea,Object.assign({htmlType:"text",multiple:!0,rows:15,readOnly:!0},n("content")))),L.a.createElement(O,Object.assign({label:" "},a),L.a.createElement(u.a,{type:"primary",onClick:this.goList.bind(this)},t.back)))))}}]),n}(L.a.Component),o.displayName="ConfigDetail",a=r))||a;t.a=Y},function(e,t,n){"use strict";n(39);var a,o,r,i=n(26),s=n.n(i),l=(n(31),n(19)),u=n.n(l),c=(n(339),n(118)),d=n.n(c),p=(n(33),n(23)),f=n.n(p),h=(n(34),n(10)),m=n.n(h),g=(n(42),n(29)),y=n.n(g),_=(n(38),n(21)),v=n.n(_),b=(n(44),n(24)),M=n.n(b),w=n(14),k=n(15),S=n(16),T=n(17),C=n(22),x=n(18),E=(n(28),n(9)),L=n.n(E),D=(n(62),n(32)),N=n.n(D),O=(n(105),n(71)),Y=n.n(O),P=(n(37),n(8)),j=n.n(P),I=n(46),A=n.n(I),R=n(0),H=n.n(R),F=n(85),z=n(1),W=n(119),B=(n(581),j.a.Item),V=Y.a.Group,U=N.a.AutoComplete,K=(0,L.a.config)((r=o=function(e){function t(e){var u;return Object(w.a)(this,t),(u=Object(S.a)(this,Object(T.a)(t).call(this,e))).publicConfigBeforeCheck=function(t){var e=u.props.locale,n=void 0===e?{}:e,a=u.state.addonBefore;Object(z.c)({url:"v1/cs/configs",data:{show:"all",dataId:a+u.field.getValue("dataId"),group:u.field.getValue("group"),tenant:Object(z.b)("namespace")||""},success:function(e){M.a.error({content:n.dataIdExists,align:"cc cc"})},error:function(e){u._publishConfig(t)}})},u._publishConfig=function(e){var n=Object(C.a)(u),t=u.props.locale,a=void 0===t?{}:t,o=u.state,r=o.addonBefore,i=o.config_tags,s=o.configType;u.tenant=Object(z.b)("namespace")||"";var l={dataId:r+u.field.getValue("dataId"),group:u.field.getValue("group"),content:e,desc:u.field.getValue("desc"),config_tags:i.join(),type:s,appName:u.inApp?u.edasAppId:u.field.getValue("appName"),tenant:u.tenant};u.serverId=Object(z.b)("serverId")||"center";Object(z.c)({type:"post",contentType:"application/x-www-form-urlencoded",url:"v1/cs/configs",data:l,beforeSend:function(){u.openLoading()},success:function(e){var t={};t.maintitle=a.newListingMain,t.title=a.newListing,t.content="",t.dataId=l.dataId,t.group=l.group,!0===e?(n.group=l.group,n.dataId=l.dataId,Object(z.d)({group:l.group,dataId:l.dataId}),t.isok=!0):(t.isok=!1,t.message=e.message),n.successDialog.current.getInstance().openDialog(t)},complete:function(){n.closeLoading()},error:function(e){v.a.alert({language:z.a.currentLanguageCode||"zh-cn",content:a.publishFailed}),n.closeLoading()}})},u.successDialog=H.a.createRef(),u.field=new y.a(Object(C.a)(u)),u.edasAppName=Object(z.b)("edasAppName")||"",u.edasAppId=Object(z.b)("edasAppId")||"",u.inApp=u.edasAppName,u.field.setValue("appName",u.inApp?u.edasAppName:""),u.inEdas=window.globalConfig.isParentEdas(),u.dataId=Object(z.b)("dataId")||"",u.group=Object(z.b)("group")||"DEFAULT_GROUP",u.searchDataId=Object(z.b)("searchDataId")||"",u.searchGroup=Object(z.b)("searchGroup")||"",u.state={configType:"text",codeValue:"",envname:"",targetEnvName:"",groups:[],groupNames:[],envlist:[],tagLst:[],config_tags:[],envvalues:[],showmore:!1,loading:!1,encrypt:!1,addonBefore:"",showGroupWarning:!1},u.codeValue="",u.mode="text",u.ips="",u}return Object(x.a)(t,e),Object(k.a)(t,[{key:"componentDidMount",value:function(){var e=this;this.betaips=document.getElementById("betaips"),this.chontenttab=document.getElementById("chontenttab"),this.tenant=Object(z.b)("namespace")||"",this.field.setValue("group",this.group),window.monaco?this.initMoacoEditor():window.importEditor(function(){e.initMoacoEditor()})}},{key:"changeModel",value:function(e){if(!this.monacoEditor)return A()("#container").empty(),void(this.monacoEditor=window.monaco.editor.create(document.getElementById("container"),{model:null}));var t=this.monacoEditor.getModel(),n=this.monacoEditor.getValue(),a=window.monaco.editor.createModel(n,e);this.monacoEditor.setModel(a),t&&t.dispose()}},{key:"initMoacoEditor",value:function(){this.monacoEditor=window.monaco.editor.create(document.getElementById("container"),{value:this.codeValue,language:this.state.configType,codeLens:!0,selectOnLineNumbers:!0,roundedSelection:!1,readOnly:!1,lineNumbersMinChars:!0,theme:"vs-dark",wordWrapColumn:120,folding:!0,showFoldingControls:"always",wordWrap:"wordWrapColumn",cursorStyle:"line",automaticLayout:!0})}},{key:"setGroup",value:function(e){this.group=e||"",this.field.setValue("group",this.group),this.inEdas&&this.setState({showGroupWarning:""!==this.group&&this.state.groupNames.indexOf(e)<0})}},{key:"setConfigTags",value:function(n){5this.state.pageSize&&P.a.createElement("div",{style:{marginTop:10,textAlign:"right"}},P.a.createElement(T.a,{current:this.state.pageNo,total:s,pageSize:this.state.pageSize,onChange:function(e){return t.setState({pageNo:e},function(){return t.querySubscriberList()})}}))))}}]),t}(P.a.Component),o.displayName="SubscriberList",a=r))||a)||a;t.a=W},function(e,t,n){"use strict";n(39);var a,o,r,i=n(26),m=n.n(i),s=(n(63),n(40)),g=n.n(s),l=(n(31),n(19)),y=n.n(l),u=(n(34),n(10)),_=n.n(u),c=(n(42),n(29)),d=n.n(c),p=n(14),f=n(15),h=n(16),v=n(17),b=n(22),M=n(18),w=(n(28),n(9)),k=n.n(w),S=(n(61),n(20)),T=n.n(S),C=(n(54),n(30)),x=n.n(C),E=(n(37),n(8)),L=n.n(E),D=n(0),N=n.n(D),O=n(1),Y=n(41),P=(n(645),L.a.Item),j=x.a.Row,I=x.a.Col,A=T.a.Column,R=(0,k.a.config)((r=o=function(e){function t(e){var n;return Object(p.a)(this,t),(n=Object(h.a)(this,Object(v.a)(t).call(this,e))).getQueryLater=function(){setTimeout(function(){return n.queryClusterStateList()})},n.setNowNameSpace=function(e,t){return n.setState({nowNamespaceName:e,nowNamespaceId:t})},n.rowColor=function(e){return{className:(e.voteFor,"")}},n.state={loading:!1,total:0,pageSize:10,currentPage:1,keyword:"",dataSource:[]},n.field=new d.a(Object(b.a)(n)),n}return Object(M.a)(t,e),Object(f.a)(t,[{key:"openLoading",value:function(){this.setState({loading:!0})}},{key:"closeLoading",value:function(){this.setState({loading:!1})}},{key:"openEditServiceDialog",value:function(){try{this.editServiceDialog.current.getInstance().show(this.state.service)}catch(e){}}},{key:"queryClusterStateList",value:function(){var i=this,e=this.state,t=e.currentPage,n=e.pageSize,a=e.keyword,o=e.withInstances,r=["withInstances=".concat(void 0!==o&&o),"pageNo=".concat(t),"pageSize=".concat(n),"keyword=".concat(a)];Object(O.c)({url:"v1/ns/operator/cluster/states?".concat(r.join("&")),beforeSend:function(){return i.openLoading()},success:function(e){var t=0this.state.pageSize&&N.a.createElement("div",{style:{marginTop:10,textAlign:"right"}},N.a.createElement(g.a,{current:this.state.currentPage,total:this.state.total,pageSize:this.state.pageSize,onChange:function(e){return t.setState({currentPage:e},function(){return t.queryClusterStateList()})}}))))}}]),t}(N.a.Component),o.displayName="ClusterNodeList",a=r))||a;t.a=R},function(e,t,n){"use strict";n(39);var a,o,r,i=n(26),s=n.n(i),l=(n(31),n(19)),u=n.n(l),c=(n(92),n(59)),d=n.n(c),p=(n(37),n(8)),f=n.n(p),h=(n(34),n(10)),m=n.n(h),g=(n(38),n(21)),y=n.n(g),_=(n(42),n(29)),v=n.n(_),b=n(14),M=n(15),w=n(16),k=n(17),S=n(22),T=n(18),C=(n(28),n(9)),x=n.n(C),E=n(0),L=n.n(E),D=n(85),N=n(1),O=(n(582),(0,x.a.config)((r=o=function(e){function n(e){var t;return Object(b.a)(this,n),(t=Object(w.a)(this,Object(k.a)(n).call(this,e))).successDialog=L.a.createRef(),t.field=new v.a(Object(S.a)(t)),t.dataId=Object(N.b)("dataId")||"yanlin",t.group=Object(N.b)("group")||"",t.serverId=Object(N.b)("serverId")||"",t.state={configType:0,envvalues:[],commonvalue:[],envComponent:"",envGroups:[],envlist:[],loading:!1,showmore:!1},t.codeValue="",t.mode="text",t.ips="",t}return Object(T.a)(n,e),Object(M.a)(n,[{key:"componentDidMount",value:function(){this.getDataDetail()}},{key:"toggleMore",value:function(){this.setState({showmore:!this.state.showmore})}},{key:"getEnvList",value:function(e){this.setState({envvalues:e}),this.envs=e}},{key:"getDomain",value:function(){var n=this;Object(N.c)({url:"/diamond-ops/env/domain",success:function(e){if(200===e.code){var t=e.data.envGroups;n.setState({envGroups:t})}}})}},{key:"getDataDetail",value:function(){var s=this,e=this.props.locale,l=void 0===e?{}:e;this.tenant=Object(N.b)("namespace")||"",this.serverId=Object(N.b)("serverId")||"center";var t="/diamond-ops/configList/detail/serverId/".concat(this.serverId,"/dataId/").concat(this.dataId,"/group/").concat(this.group,"/tenant/").concat(this.tenant,"?id=");"global"!==this.tenant&&this.tenant||(t="/diamond-ops/configList/detail/serverId/".concat(this.serverId,"/dataId/").concat(this.dataId,"/group/").concat(this.group,"?id=")),Object(N.c)({url:t,beforeSend:function(){s.openLoading()},success:function(e){if(200===e.code){var t=e.data,n=void 0===t?{}:t;s.field.setValue("dataId",n.dataId),s.field.setValue("appName",n.appName),s.field.setValue("group",n.group),s.field.setValue("content",n.content||"");for(var a=n.envs||[],o=[],r=[],i=0;i outside a "),this.isStatic()&&this.perform()},b.prototype.componentDidMount=function(){this.isStatic()||this.perform()},b.prototype.componentDidUpdate=function(e){var t=Object(d.b)(e.to),n=Object(d.b)(this.props.to);Object(d.c)(t,n)?l()(!1,"You tried to redirect to the same route you're currently on: \""+n.pathname+n.search+'"'):this.perform()},b.prototype.computeTo=function(e){var t=e.computedMatch,n=e.to;return t?"string"==typeof n?g(n,t.params):y({},n,{pathname:g(n.pathname,t.params)}):n},b.prototype.perform=function(){var e=this.context.router.history,t=this.props.push,n=this.computeTo(this.props);t?e.push(n):e.replace(n)},b.prototype.render=function(){return null},b);function b(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,b),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,_.apply(this,arguments))}v.propTypes={computedMatch:i.a.object,push:i.a.bool,from:i.a.string,to:i.a.oneOfType([i.a.string,i.a.object]).isRequired},v.defaultProps={push:!1},v.contextTypes={router:i.a.shape({history:i.a.shape({push:i.a.func.isRequired,replace:i.a.func.isRequired}).isRequired,staticContext:i.a.object}).isRequired};var M=v;t.a=M},function(e,t,n){"use strict";var a=n(0),o=n.n(a),r=n(2),i=n.n(r),s=n(149),l=n.n(s),u=n(113),c=Object.assign||function(e){for(var t=1;t=t.length?{value:void 0,done:!0}:(e=a(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){var l=n(123),u=n(122);e.exports=function(s){return function(e,t){var n,a,o=String(u(e)),r=l(t),i=o.length;return r<0||i<=r?s?"":void 0:(n=o.charCodeAt(r))<55296||56319=e.length?(this._t=void 0,o(1)):o(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values"),r.Arguments=r.Array,a("keys"),a("values"),a("entries")},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){e.exports={default:n(413),__esModule:!0}},function(e,t,n){n(414),n(419),n(420),n(421),e.exports=n(68).Symbol},function(e,t,n){"use strict";function a(e){var t=q[e]=D(H[W]);return t._k=e,t}function o(e,t){S(e);for(var n,a=w(t=x(t)),o=0,r=a.length;oo;)c(q,t=n[o++])||t==B||t==h||a.push(t);return a}function l(e){for(var t,n=e===J,a=R(n?G:x(e)),o=[],r=0;a.length>r;)!c(q,t=a[r++])||n&&!c(J,t)||o.push(q[t]);return o}var u=n(60),c=n(70),d=n(69),p=n(89),f=n(161),h=n(415).KEY,m=n(91),g=n(125),y=n(131),_=n(103),v=n(78),b=n(132),M=n(133),w=n(416),k=n(417),S=n(90),T=n(76),C=n(128),x=n(77),E=n(121),L=n(100),D=n(130),N=n(418),O=n(163),Y=n(127),P=n(75),j=n(101),I=O.f,A=P.f,R=N.f,H=u.Symbol,F=u.JSON,z=F&&F.stringify,W="prototype",B=v("_hidden"),V=v("toPrimitive"),U={}.propertyIsEnumerable,K=g("symbol-registry"),q=g("symbols"),G=g("op-symbols"),J=Object[W],$="function"==typeof H&&!!Y.f,Q=u.QObject,X=!Q||!Q[W]||!Q[W].findChild,Z=d&&m(function(){return 7!=D(A({},"a",{get:function(){return A(this,"a",{value:7}).a}})).a})?function(e,t,n){var a=I(J,t);a&&delete J[t],A(e,t,n),a&&e!==J&&A(J,t,a)}:A,ee=$&&"symbol"==typeof H.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof H},te=function(e,t,n){return e===J&&te(G,t,n),S(e),t=E(t,!0),S(n),c(q,t)?(n.enumerable?(c(e,B)&&e[B][t]&&(e[B][t]=!1),n=D(n,{enumerable:L(0,!1)})):(c(e,B)||A(e,B,L(1,{})),e[B][t]=!0),Z(e,t,n)):A(e,t,n)};$||(f((H=function(e){if(this instanceof H)throw TypeError("Symbol is not a constructor!");var t=_(0ae;)v(ne[ae++]);for(var oe=j(v.store),re=0;oe.length>re;)M(oe[re++]);p(p.S+p.F*!$,"Symbol",{for:function(e){return c(K,e+="")?K[e]:K[e]=H(e)},keyFor:function(e){if(!ee(e))throw TypeError(e+" is not a symbol!");for(var t in K)if(K[t]===e)return t},useSetter:function(){X=!0},useSimple:function(){X=!1}}),p(p.S+p.F*!$,"Object",{create:function(e,t){return void 0===t?D(e):o(D(e),t)},defineProperty:te,defineProperties:o,getOwnPropertyDescriptor:i,getOwnPropertyNames:s,getOwnPropertySymbols:l});var ie=m(function(){Y.f(1)});p(p.S+p.F*ie,"Object",{getOwnPropertySymbols:function(e){return Y.f(C(e))}}),F&&p(p.S+p.F*(!$||m(function(){var e=H();return"[null]"!=z([e])||"{}"!=z({a:e})||"{}"!=z(Object(e))})),"JSON",{stringify:function(e){for(var t,n,a=[e],o=1;oi;)r.call(e,a=o[i++])&&t.push(a);return t}},function(e,t,n){var a=n(159);e.exports=Array.isArray||function(e){return"Array"==a(e)}},function(e,t,n){var a=n(77),o=n(162).f,r={}.toString,i="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return i&&"[object Window]"==r.call(e)?function(e){try{return o(e)}catch(e){return i.slice()}}(e):o(a(e))}},function(e,t){},function(e,t,n){n(133)("asyncIterator")},function(e,t,n){n(133)("observable")},function(e,t,n){e.exports={default:n(423),__esModule:!0}},function(e,t,n){n(424),e.exports=n(68).Object.setPrototypeOf},function(e,t,n){var a=n(89);a(a.S,"Object",{setPrototypeOf:n(425).set})},function(e,t,o){function r(e,t){if(a(e),!n(t)&&null!==t)throw TypeError(t+": can't set as prototype!")}var n=o(76),a=o(90);e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,n,a){try{(a=o(154)(Function.call,o(163).f(Object.prototype,"__proto__").set,2))(e,[]),n=!(e instanceof Array)}catch(e){n=!0}return function(e,t){return r(e,t),n?e.__proto__=t:a(e,t),e}}({},!1):void 0),check:r}},function(e,t,n){e.exports={default:n(427),__esModule:!0}},function(e,t,n){n(428);var a=n(68).Object;e.exports=function(e,t){return a.create(e,t)}},function(e,t,n){var a=n(89);a(a.S,"Object",{create:n(130)})},function(e,t,n){"use strict"; /** @license React v16.8.6 * react.production.min.js * From 221d81dab8fa1ce0ee6bd8bd3dcf3f2bd102f6ce Mon Sep 17 00:00:00 2001 From: ly <641921791@qq.com> Date: Wed, 25 Sep 2019 20:49:37 +0800 Subject: [PATCH 18/22] Clean up redundant StringUtils --- .../client/config/NacosConfigService.java | 2 +- .../nacos/client/config/common/GroupKey.java | 2 +- .../client/config/http/ServerHttpAgent.java | 2 +- .../client/config/impl/ClientWorker.java | 2 +- .../config/impl/LocalConfigInfoProcessor.java | 2 +- .../nacos/client/config/impl/SpasAdapter.java | 2 +- .../listener/impl/PropertiesListener.java | 2 +- .../nacos/client/config/utils/ParamUtils.java | 2 +- .../client/identify/CredentialService.java | 2 +- .../client/identify/CredentialWatcher.java | 2 +- .../nacos/client/identify/STSConfig.java | 2 +- .../client/logging/AbstractNacosLogging.java | 2 +- .../logging/logback/LogbackNacosLogging.java | 2 +- .../naming/NacosNamingMaintainService.java | 2 +- .../client/naming/NacosNamingService.java | 2 +- .../naming/backups/FailoverReactor.java | 2 +- .../nacos/client/naming/cache/DiskCache.java | 2 +- .../nacos/client/naming/core/HostReactor.java | 2 +- .../nacos/client/naming/net/HttpClient.java | 2 +- .../nacos/client/naming/net/NamingProxy.java | 4 +- .../nacos/client/naming/utils/IoUtils.java | 2 +- .../nacos/client/naming/utils/NetUtils.java | 2 +- .../alibaba/nacos/client/utils/ParamUtil.java | 6 +- .../nacos/client/utils/StringUtils.java | 2 + .../alibaba/nacos/client/StringUtilsTest.java | 1 + .../service/LocalDataSourceServiceImpl.java | 2 +- .../config/server/service/dump/DumpTask.java | 2 +- .../service/merge/MergeTaskProcessor.java | 2 +- .../service/notify/AsyncNotifyService.java | 2 +- .../config/server/utils/AppNameUtils.java | 2 + .../nacos/config/server/utils/GroupKey.java | 2 + .../nacos/config/server/utils/GroupKey2.java | 2 + .../config/server/utils/RequestUtil.java | 2 + .../config/server/utils/StringUtils.java | 69 ------------------- .../controller/NamespaceController.java | 2 +- 35 files changed, 42 insertions(+), 100 deletions(-) delete mode 100644 config/src/main/java/com/alibaba/nacos/config/server/utils/StringUtils.java diff --git a/client/src/main/java/com/alibaba/nacos/client/config/NacosConfigService.java b/client/src/main/java/com/alibaba/nacos/client/config/NacosConfigService.java index a9ac0c9b9..8f889a660 100644 --- a/client/src/main/java/com/alibaba/nacos/client/config/NacosConfigService.java +++ b/client/src/main/java/com/alibaba/nacos/client/config/NacosConfigService.java @@ -33,9 +33,9 @@ import com.alibaba.nacos.client.config.impl.LocalConfigInfoProcessor; import com.alibaba.nacos.client.config.utils.ContentUtils; import com.alibaba.nacos.client.config.utils.ParamUtils; import com.alibaba.nacos.client.utils.LogUtils; -import com.alibaba.nacos.client.utils.StringUtils; import com.alibaba.nacos.client.utils.TemplateUtils; import com.alibaba.nacos.client.utils.TenantUtil; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import java.io.IOException; diff --git a/client/src/main/java/com/alibaba/nacos/client/config/common/GroupKey.java b/client/src/main/java/com/alibaba/nacos/client/config/common/GroupKey.java index 2f7d527ef..aa0a26197 100644 --- a/client/src/main/java/com/alibaba/nacos/client/config/common/GroupKey.java +++ b/client/src/main/java/com/alibaba/nacos/client/config/common/GroupKey.java @@ -15,7 +15,7 @@ */ package com.alibaba.nacos.client.config.common; -import com.alibaba.nacos.client.utils.StringUtils; +import org.apache.commons.lang3.StringUtils; /** * Synthesize the form of dataId+groupId. Escapes reserved characters in dataId and groupId. diff --git a/client/src/main/java/com/alibaba/nacos/client/config/http/ServerHttpAgent.java b/client/src/main/java/com/alibaba/nacos/client/config/http/ServerHttpAgent.java index 0ba8f8a82..ce2d43e3f 100644 --- a/client/src/main/java/com/alibaba/nacos/client/config/http/ServerHttpAgent.java +++ b/client/src/main/java/com/alibaba/nacos/client/config/http/ServerHttpAgent.java @@ -28,9 +28,9 @@ import com.alibaba.nacos.client.utils.TemplateUtils; import com.alibaba.nacos.client.utils.JSONUtils; import com.alibaba.nacos.client.utils.LogUtils; import com.alibaba.nacos.client.utils.ParamUtil; -import com.alibaba.nacos.client.utils.StringUtils; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.type.TypeReference; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import org.slf4j.Logger; import java.io.IOException; diff --git a/client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java b/client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java index 4e89dcbdf..6a86d0fd5 100644 --- a/client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java +++ b/client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java @@ -28,7 +28,7 @@ import com.alibaba.nacos.client.config.utils.MD5; import com.alibaba.nacos.client.monitor.MetricsMonitor; import com.alibaba.nacos.client.utils.LogUtils; import com.alibaba.nacos.client.utils.ParamUtil; -import com.alibaba.nacos.client.utils.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import com.alibaba.nacos.client.utils.TenantUtil; import org.slf4j.Logger; diff --git a/client/src/main/java/com/alibaba/nacos/client/config/impl/LocalConfigInfoProcessor.java b/client/src/main/java/com/alibaba/nacos/client/config/impl/LocalConfigInfoProcessor.java index f41003cc6..715034073 100644 --- a/client/src/main/java/com/alibaba/nacos/client/config/impl/LocalConfigInfoProcessor.java +++ b/client/src/main/java/com/alibaba/nacos/client/config/impl/LocalConfigInfoProcessor.java @@ -21,7 +21,7 @@ import com.alibaba.nacos.client.config.utils.IOUtils; import com.alibaba.nacos.client.config.utils.JVMUtil; import com.alibaba.nacos.client.config.utils.SnapShotSwitch; import com.alibaba.nacos.client.utils.LogUtils; -import com.alibaba.nacos.client.utils.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import java.io.File; diff --git a/client/src/main/java/com/alibaba/nacos/client/config/impl/SpasAdapter.java b/client/src/main/java/com/alibaba/nacos/client/config/impl/SpasAdapter.java index 7db3a4fdc..c881b23ce 100644 --- a/client/src/main/java/com/alibaba/nacos/client/config/impl/SpasAdapter.java +++ b/client/src/main/java/com/alibaba/nacos/client/config/impl/SpasAdapter.java @@ -18,7 +18,7 @@ package com.alibaba.nacos.client.config.impl; import com.alibaba.nacos.api.common.Constants; import com.alibaba.nacos.client.identify.Base64; import com.alibaba.nacos.client.identify.CredentialService; -import com.alibaba.nacos.client.utils.StringUtils; +import org.apache.commons.lang3.StringUtils; import javax.crypto.Mac; import javax.crypto.SecretKey; diff --git a/client/src/main/java/com/alibaba/nacos/client/config/listener/impl/PropertiesListener.java b/client/src/main/java/com/alibaba/nacos/client/config/listener/impl/PropertiesListener.java index bab7f1125..37aed761f 100644 --- a/client/src/main/java/com/alibaba/nacos/client/config/listener/impl/PropertiesListener.java +++ b/client/src/main/java/com/alibaba/nacos/client/config/listener/impl/PropertiesListener.java @@ -17,7 +17,7 @@ package com.alibaba.nacos.client.config.listener.impl; import com.alibaba.nacos.api.config.listener.AbstractListener; import com.alibaba.nacos.client.utils.LogUtils; -import com.alibaba.nacos.client.utils.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import java.io.IOException; diff --git a/client/src/main/java/com/alibaba/nacos/client/config/utils/ParamUtils.java b/client/src/main/java/com/alibaba/nacos/client/config/utils/ParamUtils.java index 477db7e27..c42baef4e 100644 --- a/client/src/main/java/com/alibaba/nacos/client/config/utils/ParamUtils.java +++ b/client/src/main/java/com/alibaba/nacos/client/config/utils/ParamUtils.java @@ -19,7 +19,7 @@ import java.util.List; import com.alibaba.nacos.api.exception.NacosException; import com.alibaba.nacos.client.utils.IPUtil; -import com.alibaba.nacos.client.utils.StringUtils; +import org.apache.commons.lang3.StringUtils; /** * Param check util diff --git a/client/src/main/java/com/alibaba/nacos/client/identify/CredentialService.java b/client/src/main/java/com/alibaba/nacos/client/identify/CredentialService.java index 4ce6edb67..f238345fc 100644 --- a/client/src/main/java/com/alibaba/nacos/client/identify/CredentialService.java +++ b/client/src/main/java/com/alibaba/nacos/client/identify/CredentialService.java @@ -16,7 +16,7 @@ package com.alibaba.nacos.client.identify; import com.alibaba.nacos.client.utils.LogUtils; -import com.alibaba.nacos.client.utils.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import java.util.concurrent.ConcurrentHashMap; diff --git a/client/src/main/java/com/alibaba/nacos/client/identify/CredentialWatcher.java b/client/src/main/java/com/alibaba/nacos/client/identify/CredentialWatcher.java index 47c39b6e3..103891e79 100644 --- a/client/src/main/java/com/alibaba/nacos/client/identify/CredentialWatcher.java +++ b/client/src/main/java/com/alibaba/nacos/client/identify/CredentialWatcher.java @@ -16,7 +16,7 @@ package com.alibaba.nacos.client.identify; import com.alibaba.nacos.client.utils.LogUtils; -import com.alibaba.nacos.client.utils.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import java.io.*; diff --git a/client/src/main/java/com/alibaba/nacos/client/identify/STSConfig.java b/client/src/main/java/com/alibaba/nacos/client/identify/STSConfig.java index dfc76b141..80139020e 100644 --- a/client/src/main/java/com/alibaba/nacos/client/identify/STSConfig.java +++ b/client/src/main/java/com/alibaba/nacos/client/identify/STSConfig.java @@ -15,7 +15,7 @@ */ package com.alibaba.nacos.client.identify; -import com.alibaba.nacos.client.utils.StringUtils; +import org.apache.commons.lang3.StringUtils; /** * Sts config diff --git a/client/src/main/java/com/alibaba/nacos/client/logging/AbstractNacosLogging.java b/client/src/main/java/com/alibaba/nacos/client/logging/AbstractNacosLogging.java index 2fae7c74e..e7512f522 100644 --- a/client/src/main/java/com/alibaba/nacos/client/logging/AbstractNacosLogging.java +++ b/client/src/main/java/com/alibaba/nacos/client/logging/AbstractNacosLogging.java @@ -15,8 +15,8 @@ */ package com.alibaba.nacos.client.logging; -import com.alibaba.nacos.client.utils.StringUtils; import org.apache.commons.lang3.BooleanUtils; +import org.apache.commons.lang3.StringUtils; /** * @author hxy1991 diff --git a/client/src/main/java/com/alibaba/nacos/client/logging/logback/LogbackNacosLogging.java b/client/src/main/java/com/alibaba/nacos/client/logging/logback/LogbackNacosLogging.java index 68c053830..13739e528 100644 --- a/client/src/main/java/com/alibaba/nacos/client/logging/logback/LogbackNacosLogging.java +++ b/client/src/main/java/com/alibaba/nacos/client/logging/logback/LogbackNacosLogging.java @@ -18,8 +18,8 @@ package com.alibaba.nacos.client.logging.logback; import ch.qos.logback.classic.LoggerContext; import ch.qos.logback.classic.util.ContextInitializer; import com.alibaba.nacos.client.logging.AbstractNacosLogging; -import com.alibaba.nacos.client.utils.StringUtils; import com.alibaba.nacos.common.util.ResourceUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.impl.StaticLoggerBinder; /** diff --git a/client/src/main/java/com/alibaba/nacos/client/naming/NacosNamingMaintainService.java b/client/src/main/java/com/alibaba/nacos/client/naming/NacosNamingMaintainService.java index 15b4ae14f..c3652e75f 100644 --- a/client/src/main/java/com/alibaba/nacos/client/naming/NacosNamingMaintainService.java +++ b/client/src/main/java/com/alibaba/nacos/client/naming/NacosNamingMaintainService.java @@ -27,7 +27,7 @@ import com.alibaba.nacos.api.selector.ExpressionSelector; import com.alibaba.nacos.api.selector.NoneSelector; import com.alibaba.nacos.client.naming.net.NamingProxy; import com.alibaba.nacos.client.naming.utils.InitUtils; -import com.alibaba.nacos.client.utils.StringUtils; +import org.apache.commons.lang3.StringUtils; import java.util.Map; import java.util.Properties; diff --git a/client/src/main/java/com/alibaba/nacos/client/naming/NacosNamingService.java b/client/src/main/java/com/alibaba/nacos/client/naming/NacosNamingService.java index 4c61a73c5..3e5fb334c 100644 --- a/client/src/main/java/com/alibaba/nacos/client/naming/NacosNamingService.java +++ b/client/src/main/java/com/alibaba/nacos/client/naming/NacosNamingService.java @@ -34,8 +34,8 @@ import com.alibaba.nacos.client.naming.net.NamingProxy; import com.alibaba.nacos.client.naming.utils.CollectionUtils; import com.alibaba.nacos.client.naming.utils.InitUtils; import com.alibaba.nacos.client.naming.utils.UtilAndComs; -import com.alibaba.nacos.client.utils.StringUtils; import org.apache.commons.lang3.BooleanUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import java.util.ArrayList; diff --git a/client/src/main/java/com/alibaba/nacos/client/naming/backups/FailoverReactor.java b/client/src/main/java/com/alibaba/nacos/client/naming/backups/FailoverReactor.java index 52c2ee972..cdf4ff80f 100644 --- a/client/src/main/java/com/alibaba/nacos/client/naming/backups/FailoverReactor.java +++ b/client/src/main/java/com/alibaba/nacos/client/naming/backups/FailoverReactor.java @@ -22,7 +22,7 @@ import com.alibaba.nacos.client.naming.cache.DiskCache; import com.alibaba.nacos.client.naming.core.HostReactor; import com.alibaba.nacos.client.naming.utils.CollectionUtils; import com.alibaba.nacos.client.naming.utils.UtilAndComs; -import com.alibaba.nacos.client.utils.StringUtils; +import org.apache.commons.lang3.StringUtils; import java.io.BufferedReader; import java.io.File; diff --git a/client/src/main/java/com/alibaba/nacos/client/naming/cache/DiskCache.java b/client/src/main/java/com/alibaba/nacos/client/naming/cache/DiskCache.java index 6fe5a4a72..9394f8768 100644 --- a/client/src/main/java/com/alibaba/nacos/client/naming/cache/DiskCache.java +++ b/client/src/main/java/com/alibaba/nacos/client/naming/cache/DiskCache.java @@ -20,7 +20,7 @@ import com.alibaba.nacos.api.common.Constants; import com.alibaba.nacos.api.naming.pojo.Instance; import com.alibaba.nacos.api.naming.pojo.ServiceInfo; import com.alibaba.nacos.client.naming.utils.CollectionUtils; -import com.alibaba.nacos.client.utils.StringUtils; +import org.apache.commons.lang3.StringUtils; import java.io.BufferedReader; import java.io.File; diff --git a/client/src/main/java/com/alibaba/nacos/client/naming/core/HostReactor.java b/client/src/main/java/com/alibaba/nacos/client/naming/core/HostReactor.java index 65d711c22..bb96821c3 100644 --- a/client/src/main/java/com/alibaba/nacos/client/naming/core/HostReactor.java +++ b/client/src/main/java/com/alibaba/nacos/client/naming/core/HostReactor.java @@ -24,7 +24,7 @@ import com.alibaba.nacos.client.naming.backups.FailoverReactor; import com.alibaba.nacos.client.naming.cache.DiskCache; import com.alibaba.nacos.client.naming.net.NamingProxy; import com.alibaba.nacos.client.naming.utils.UtilAndComs; -import com.alibaba.nacos.client.utils.StringUtils; +import org.apache.commons.lang3.StringUtils; import java.util.*; import java.util.concurrent.*; diff --git a/client/src/main/java/com/alibaba/nacos/client/naming/net/HttpClient.java b/client/src/main/java/com/alibaba/nacos/client/naming/net/HttpClient.java index 3259d53c9..c58248754 100644 --- a/client/src/main/java/com/alibaba/nacos/client/naming/net/HttpClient.java +++ b/client/src/main/java/com/alibaba/nacos/client/naming/net/HttpClient.java @@ -17,8 +17,8 @@ package com.alibaba.nacos.client.naming.net; import com.alibaba.nacos.api.common.Constants; import com.alibaba.nacos.client.naming.utils.IoUtils; -import com.alibaba.nacos.client.utils.StringUtils; import com.google.common.net.HttpHeaders; +import org.apache.commons.lang3.StringUtils; import java.io.IOException; import java.io.InputStream; diff --git a/client/src/main/java/com/alibaba/nacos/client/naming/net/NamingProxy.java b/client/src/main/java/com/alibaba/nacos/client/naming/net/NamingProxy.java index 3eec5d752..d52c48486 100644 --- a/client/src/main/java/com/alibaba/nacos/client/naming/net/NamingProxy.java +++ b/client/src/main/java/com/alibaba/nacos/client/naming/net/NamingProxy.java @@ -33,12 +33,12 @@ import com.alibaba.nacos.client.monitor.MetricsMonitor; import com.alibaba.nacos.client.naming.beat.BeatInfo; import com.alibaba.nacos.client.naming.utils.*; import com.alibaba.nacos.client.utils.AppNameUtils; -import com.alibaba.nacos.client.utils.StringUtils; import com.alibaba.nacos.client.utils.TemplateUtils; import com.alibaba.nacos.common.constant.HttpHeaderConsts; import com.alibaba.nacos.common.util.HttpMethod; import com.alibaba.nacos.common.util.UuidUtils; import com.alibaba.nacos.common.util.VersionUtils; +import org.apache.commons.lang3.StringUtils; import java.io.IOException; import java.io.StringReader; @@ -558,7 +558,7 @@ public class NamingProxy { this.serverPort = serverPort; String sp = System.getProperty(SystemPropertyKeyConst.NAMING_SERVER_PORT); - if (com.alibaba.nacos.client.utils.StringUtils.isNotBlank(sp)) { + if (StringUtils.isNotBlank(sp)) { this.serverPort = Integer.parseInt(sp); } } diff --git a/client/src/main/java/com/alibaba/nacos/client/naming/utils/IoUtils.java b/client/src/main/java/com/alibaba/nacos/client/naming/utils/IoUtils.java index b4a5afdde..b1011eee1 100644 --- a/client/src/main/java/com/alibaba/nacos/client/naming/utils/IoUtils.java +++ b/client/src/main/java/com/alibaba/nacos/client/naming/utils/IoUtils.java @@ -16,7 +16,7 @@ package com.alibaba.nacos.client.naming.utils; -import com.alibaba.nacos.client.utils.StringUtils; +import org.apache.commons.lang3.StringUtils; import java.io.*; import java.nio.channels.FileChannel; diff --git a/client/src/main/java/com/alibaba/nacos/client/naming/utils/NetUtils.java b/client/src/main/java/com/alibaba/nacos/client/naming/utils/NetUtils.java index e192e577c..db077df0b 100644 --- a/client/src/main/java/com/alibaba/nacos/client/naming/utils/NetUtils.java +++ b/client/src/main/java/com/alibaba/nacos/client/naming/utils/NetUtils.java @@ -15,7 +15,7 @@ */ package com.alibaba.nacos.client.naming.utils; -import com.alibaba.nacos.client.utils.StringUtils; +import org.apache.commons.lang3.StringUtils; import java.net.InetAddress; import java.net.UnknownHostException; diff --git a/client/src/main/java/com/alibaba/nacos/client/utils/ParamUtil.java b/client/src/main/java/com/alibaba/nacos/client/utils/ParamUtil.java index 9145fa662..e579f635f 100644 --- a/client/src/main/java/com/alibaba/nacos/client/utils/ParamUtil.java +++ b/client/src/main/java/com/alibaba/nacos/client/utils/ParamUtil.java @@ -157,7 +157,7 @@ public class ParamUtil { || !PATTERN.matcher(endpointUrl).find()) { // skip retrieve from system property and retrieve directly from system env String endpointUrlSource = System.getenv(PropertyKeyConst.SystemEnv.ALIBABA_ALIWARE_ENDPOINT_URL); - if (com.alibaba.nacos.client.utils.StringUtils.isNotBlank(endpointUrlSource)) { + if (StringUtils.isNotBlank(endpointUrlSource)) { endpointUrl = endpointUrlSource; } @@ -182,8 +182,8 @@ public class ParamUtil { }); - if (com.alibaba.nacos.client.utils.StringUtils.isBlank(endpointUrlSource)) { - if (com.alibaba.nacos.client.utils.StringUtils.isNotBlank(defaultEndpointUrl)) { + if (StringUtils.isBlank(endpointUrlSource)) { + if (StringUtils.isNotBlank(defaultEndpointUrl)) { endpointUrl = defaultEndpointUrl; } } else { diff --git a/client/src/main/java/com/alibaba/nacos/client/utils/StringUtils.java b/client/src/main/java/com/alibaba/nacos/client/utils/StringUtils.java index 975cf97f9..5241be6da 100644 --- a/client/src/main/java/com/alibaba/nacos/client/utils/StringUtils.java +++ b/client/src/main/java/com/alibaba/nacos/client/utils/StringUtils.java @@ -25,7 +25,9 @@ import java.util.Locale; * string util * * @author Nacos + * @deprecated Use {@link org.apache.commons.lang3.StringUtils} instead */ +@Deprecated public class StringUtils { private static final int INDEX_NOT_FOUND = -1; diff --git a/client/src/test/java/com/alibaba/nacos/client/StringUtilsTest.java b/client/src/test/java/com/alibaba/nacos/client/StringUtilsTest.java index bcc16b939..2b8a7027e 100644 --- a/client/src/test/java/com/alibaba/nacos/client/StringUtilsTest.java +++ b/client/src/test/java/com/alibaba/nacos/client/StringUtilsTest.java @@ -9,6 +9,7 @@ import java.util.Collection; import static org.junit.Assert.*; import static com.alibaba.nacos.client.utils.StringUtils.*; +@Deprecated public class StringUtilsTest { @Test diff --git a/config/src/main/java/com/alibaba/nacos/config/server/service/LocalDataSourceServiceImpl.java b/config/src/main/java/com/alibaba/nacos/config/server/service/LocalDataSourceServiceImpl.java index 0786ed4bb..0e0e637fc 100644 --- a/config/src/main/java/com/alibaba/nacos/config/server/service/LocalDataSourceServiceImpl.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/service/LocalDataSourceServiceImpl.java @@ -18,8 +18,8 @@ package com.alibaba.nacos.config.server.service; import com.alibaba.nacos.config.server.constant.Constants; import com.alibaba.nacos.config.server.utils.LogUtil; import com.alibaba.nacos.config.server.utils.PropertyUtil; -import com.alibaba.nacos.config.server.utils.StringUtils; import org.apache.commons.dbcp.BasicDataSource; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/config/src/main/java/com/alibaba/nacos/config/server/service/dump/DumpTask.java b/config/src/main/java/com/alibaba/nacos/config/server/service/dump/DumpTask.java index 2c93dacb1..138b0ff03 100755 --- a/config/src/main/java/com/alibaba/nacos/config/server/service/dump/DumpTask.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/service/dump/DumpTask.java @@ -29,7 +29,7 @@ import com.alibaba.nacos.config.server.service.trace.ConfigTraceService; import com.alibaba.nacos.config.server.utils.GroupKey2; import com.alibaba.nacos.config.server.utils.LogUtil; import com.alibaba.nacos.config.server.utils.MD5; -import com.alibaba.nacos.config.server.utils.StringUtils; +import org.apache.commons.lang3.StringUtils; import java.sql.Timestamp; import java.util.List; diff --git a/config/src/main/java/com/alibaba/nacos/config/server/service/merge/MergeTaskProcessor.java b/config/src/main/java/com/alibaba/nacos/config/server/service/merge/MergeTaskProcessor.java index 8b63d8d10..d151a5a17 100755 --- a/config/src/main/java/com/alibaba/nacos/config/server/service/merge/MergeTaskProcessor.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/service/merge/MergeTaskProcessor.java @@ -25,9 +25,9 @@ import com.alibaba.nacos.config.server.service.ConfigDataChangeEvent; import com.alibaba.nacos.config.server.service.PersistService; import com.alibaba.nacos.config.server.service.trace.ConfigTraceService; import com.alibaba.nacos.config.server.utils.ContentUtils; -import com.alibaba.nacos.config.server.utils.StringUtils; import com.alibaba.nacos.config.server.utils.TimeUtils; import com.alibaba.nacos.config.server.utils.event.EventDispatcher; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/config/src/main/java/com/alibaba/nacos/config/server/service/notify/AsyncNotifyService.java b/config/src/main/java/com/alibaba/nacos/config/server/service/notify/AsyncNotifyService.java index 5df6ef3ab..a6bad3e03 100644 --- a/config/src/main/java/com/alibaba/nacos/config/server/service/notify/AsyncNotifyService.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/service/notify/AsyncNotifyService.java @@ -23,9 +23,9 @@ import com.alibaba.nacos.config.server.service.trace.ConfigTraceService; import com.alibaba.nacos.config.server.utils.LogUtil; import com.alibaba.nacos.config.server.utils.PropertyUtil; import com.alibaba.nacos.config.server.utils.RunningConfigUtils; -import com.alibaba.nacos.config.server.utils.StringUtils; import com.alibaba.nacos.config.server.utils.event.EventDispatcher.AbstractEventListener; import com.alibaba.nacos.config.server.utils.event.EventDispatcher.Event; +import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import org.apache.http.client.config.RequestConfig; diff --git a/config/src/main/java/com/alibaba/nacos/config/server/utils/AppNameUtils.java b/config/src/main/java/com/alibaba/nacos/config/server/utils/AppNameUtils.java index d27f29594..4877c030c 100644 --- a/config/src/main/java/com/alibaba/nacos/config/server/utils/AppNameUtils.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/utils/AppNameUtils.java @@ -15,6 +15,8 @@ */ package com.alibaba.nacos.config.server.utils; +import org.apache.commons.lang3.StringUtils; + import java.io.File; /** diff --git a/config/src/main/java/com/alibaba/nacos/config/server/utils/GroupKey.java b/config/src/main/java/com/alibaba/nacos/config/server/utils/GroupKey.java index 4b10b1946..7ba66ae7e 100644 --- a/config/src/main/java/com/alibaba/nacos/config/server/utils/GroupKey.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/utils/GroupKey.java @@ -15,6 +15,8 @@ */ package com.alibaba.nacos.config.server.utils; +import org.apache.commons.lang3.StringUtils; + /** * 合成dataId+groupId的形式。对dataId和groupId中的保留字符做转义。 * diff --git a/config/src/main/java/com/alibaba/nacos/config/server/utils/GroupKey2.java b/config/src/main/java/com/alibaba/nacos/config/server/utils/GroupKey2.java index 8f0c7d301..4e0c86f6b 100644 --- a/config/src/main/java/com/alibaba/nacos/config/server/utils/GroupKey2.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/utils/GroupKey2.java @@ -15,6 +15,8 @@ */ package com.alibaba.nacos.config.server.utils; +import org.apache.commons.lang3.StringUtils; + /** * Group key util * diff --git a/config/src/main/java/com/alibaba/nacos/config/server/utils/RequestUtil.java b/config/src/main/java/com/alibaba/nacos/config/server/utils/RequestUtil.java index 2f293eeeb..08e50b1fd 100644 --- a/config/src/main/java/com/alibaba/nacos/config/server/utils/RequestUtil.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/utils/RequestUtil.java @@ -15,6 +15,8 @@ */ package com.alibaba.nacos.config.server.utils; +import org.apache.commons.lang3.StringUtils; + import javax.servlet.http.HttpServletRequest; /** diff --git a/config/src/main/java/com/alibaba/nacos/config/server/utils/StringUtils.java b/config/src/main/java/com/alibaba/nacos/config/server/utils/StringUtils.java deleted file mode 100644 index 7c491ca80..000000000 --- a/config/src/main/java/com/alibaba/nacos/config/server/utils/StringUtils.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.alibaba.nacos.config.server.utils; - -/** - * 替代common-lang中类,减少依赖 - * - * @author Nacos - */ -public class StringUtils { - - public static final int INDEX_NOT_FOUND = -1; - - public static boolean isBlank(String str) { - int strLen; - if (str == null || (strLen = str.length()) == 0) { - return true; - } - for (int i = 0; i < strLen; i++) { - if ((Character.isWhitespace(str.charAt(i)) == false)) { - return false; - } - } - return true; - } - - public static boolean isNotEmpty(String str) { - return !StringUtils.isEmpty(str); - } - - public static boolean isEmpty(String str) { - return str == null || str.length() == 0; - } - - public static String defaultIfEmpty(String str, String defaultStr) { - return StringUtils.isEmpty(str) ? defaultStr : str; - } - - public static boolean equals(String str1, String str2) { - return str1 == null ? str2 == null : str1.equals(str2); - } - - public static String substringBetween(String str, String open, String close) { - if (str == null || open == null || close == null) { - return null; - } - int start = str.indexOf(open); - if (start != INDEX_NOT_FOUND) { - int end = str.indexOf(close, start + open.length()); - if (end != INDEX_NOT_FOUND) { - return str.substring(start + open.length(), end); - } - } - return null; - } -} diff --git a/console/src/main/java/com/alibaba/nacos/console/controller/NamespaceController.java b/console/src/main/java/com/alibaba/nacos/console/controller/NamespaceController.java index a6250e576..b7ec2611b 100644 --- a/console/src/main/java/com/alibaba/nacos/console/controller/NamespaceController.java +++ b/console/src/main/java/com/alibaba/nacos/console/controller/NamespaceController.java @@ -19,9 +19,9 @@ import com.alibaba.nacos.api.exception.NacosException; import com.alibaba.nacos.config.server.model.RestResult; import com.alibaba.nacos.config.server.model.TenantInfo; import com.alibaba.nacos.config.server.service.PersistService; -import com.alibaba.nacos.config.server.utils.StringUtils; import com.alibaba.nacos.console.model.Namespace; import com.alibaba.nacos.console.model.NamespaceAllInfo; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; From 63d044c6cb1ad1d5259ba209cfcfd63b0aae569b Mon Sep 17 00:00:00 2001 From: bruce <841326226@qq.com> Date: Fri, 27 Sep 2019 18:42:42 +0800 Subject: [PATCH 19/22] bug fix 1841 bug fix https://github.com/alibaba/nacos/issues/1841 --- console/src/main/resources/application.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console/src/main/resources/application.properties b/console/src/main/resources/application.properties index a123f5a35..601f685a0 100644 --- a/console/src/main/resources/application.properties +++ b/console/src/main/resources/application.properties @@ -27,4 +27,4 @@ server.tomcat.basedir= #management.security=false #security.basic.enabled=false #nacos.security.ignore.urls=/** -nacos.security.ignore.urls=/,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/v1/auth/login,/v1/console/health/**,/v1/cs/**,/v1/ns/**,/v1/cmdb/**,/actuator/**,/v1/console/server/** +nacos.security.ignore.urls=/,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/v1/auth/login,/v1/console/health/**,/v1/cs/**,/v1/ns/**,/v1/cmdb/**,/actuator/**,/v1/console/server/** From 299c533c6cb86e53493ab66cb3cd8d150097986a Mon Sep 17 00:00:00 2001 From: satjd Date: Fri, 11 Oct 2019 11:28:58 +0800 Subject: [PATCH 20/22] fix #1916 --- .../alibaba/nacos/naming/core/ServiceManager.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/naming/src/main/java/com/alibaba/nacos/naming/core/ServiceManager.java b/naming/src/main/java/com/alibaba/nacos/naming/core/ServiceManager.java index a379a8e2b..19337a33e 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/core/ServiceManager.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/core/ServiceManager.java @@ -445,9 +445,9 @@ public class ServiceManager implements RecordListener { service.getClusterMap().put(cluster.getName(), cluster); } service.validate(); - if (local) { - putServiceAndInit(service); - } else { + + putServiceAndInit(service); + if (!local) { addOrReplaceService(service); } } @@ -470,9 +470,9 @@ public class ServiceManager implements RecordListener { service.getClusterMap().put(cluster.getName(), cluster); } service.validate(); - if (local) { - putServiceAndInit(service); - } else { + + putServiceAndInit(service); + if (!local) { addOrReplaceService(service); } } From 395b20c8ea7cb322f37f3b2249744e6b3e1e8c0d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 12 Oct 2019 03:04:56 +0000 Subject: [PATCH 21/22] Bump netty-all from 4.0.42.Final to 4.1.42.Final Bumps [netty-all](https://github.com/netty/netty) from 4.0.42.Final to 4.1.42.Final. - [Release notes](https://github.com/netty/netty/releases) - [Commits](https://github.com/netty/netty/compare/netty-4.0.42.Final...netty-4.1.42.Final) Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a9611dd96..c42681966 100644 --- a/pom.xml +++ b/pom.xml @@ -703,7 +703,7 @@ io.netty netty-all - 4.0.42.Final + 4.1.42.Final From 5939cec9bc90cf10ea8ece003006c50fae93467f Mon Sep 17 00:00:00 2001 From: Nicholas2015 <799327210@qq.com> Date: Thu, 17 Oct 2019 22:47:40 +0800 Subject: [PATCH 22/22] fix the getting subscribers error --- .../com/alibaba/nacos/naming/core/SubscribeManager.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/naming/src/main/java/com/alibaba/nacos/naming/core/SubscribeManager.java b/naming/src/main/java/com/alibaba/nacos/naming/core/SubscribeManager.java index 223f583af..2614d48a5 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/core/SubscribeManager.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/core/SubscribeManager.java @@ -26,6 +26,7 @@ import com.alibaba.nacos.naming.misc.UtilsAndCommons; import com.alibaba.nacos.naming.pojo.Subscriber; import com.alibaba.nacos.naming.pojo.Subscribers; import com.alibaba.nacos.naming.push.PushService; +import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -80,6 +81,7 @@ public class SubscribeManager { paramValues.put("aggregation", String.valueOf(Boolean.FALSE)); if (NetUtils.localServer().equals(server.getKey())) { subscriberList.addAll(getSubscribers(serviceName, namespaceId)); + continue; } HttpClient.HttpResult result = HttpClient.httpGet("http://" + server.getKey() + RunningConfig.getContextPath() @@ -89,14 +91,14 @@ public class SubscribeManager { Subscribers subscribers = (Subscribers) JSONObject.parseObject(result.content, Subscribers.class); subscriberList.addAll(subscribers.getSubscribers()); } - return subscriberList.stream().filter(distinctByKey(Subscriber::toString)).collect(Collectors.toList()); - } + return CollectionUtils.isNotEmpty(subscriberList) ? + subscriberList.stream().filter(distinctByKey(Subscriber::toString)).collect(Collectors.toList()) + : Collections.EMPTY_LIST; } else { // local server return getSubscribers(serviceName, namespaceId); } - return Collections.emptyList(); } public static Predicate distinctByKey(Function keyExtractor) {