From c617afeaa441fd949682fb9e79fd878a62f2ae07 Mon Sep 17 00:00:00 2001 From: liaochuntao Date: Fri, 21 Aug 2020 12:58:36 +0800 Subject: [PATCH] Jraft naming (#3660) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix-#3595, delete the unnecessary code (#3596) * [ISSUE #3566] move the permission code of nacos-core module to nacos-auth module (#3593) * move the permission code of nacos-core module to nacos-auth module. * Fix some code style issues * address server module auth package name change. * test change * Incorrect package name correction * [ISSUE #3592] Fix incorrect prompt when accessing the restricted namespace (#3603) * Fix incorrect prompt when accessing the restricted namespace * Modify variable name * [ISSUE #3600] Replace the deprecated api of jwt (#3616) * replace the deprecated api of jwt * transfer secretKey to byte array just using String encode with utf-8 * [ISSUE #3613] Fix `unit test method not be static` & update publish config listener in `ConfigTest.java` (#3614) * fix `unit test method not be static` & update publish config listener in `ConfigTest.java` * fix `unit test method not be static` & update publish config listener in `ConfigTest.java` * move jwt dependency from console,core to auth. (#3624) * fix: create kvstorage * refactor: create kv storage] Co-authored-by: 赵延 <1060026287@qq.com> Co-authored-by: mai.jh Co-authored-by: ljhrot <296093710@qq.com> Co-authored-by: Xarrow --- .../auth/AddressServerAuthManager.java | 8 +- .../AddressServerSpringConfiguration.java | 2 +- auth/pom.xml | 29 +++ .../com/alibaba/nacos}/auth/AuthManager.java | 7 +- .../nacos/auth/annotation}/Secured.java | 6 +- .../nacos/auth/common}/ActionTypes.java | 3 +- .../nacos/auth/common}/AuthConfigs.java | 39 ++-- .../nacos/auth/common}/AuthSystemTypes.java | 3 +- .../auth/common}/env/ReloadableConfigs.java | 3 +- .../auth/exception}/AccessException.java | 3 +- .../alibaba/nacos/auth/model}/Permission.java | 3 +- .../alibaba/nacos/auth/model}/Resource.java | 3 +- .../com/alibaba/nacos/auth/model}/User.java | 3 +- .../auth/parser}/DefaultResourceParser.java | 3 +- .../nacos/auth/parser}/ResourceParser.java | 3 +- .../com/alibaba/nacos/client/ConfigTest.java | 50 +++-- .../server/auth/ConfigResourceParser.java | 5 +- .../server/controller/ConfigController.java | 4 +- .../controller/ConfigOpsController.java | 4 +- .../config/server/utils/RequestUtil.java | 2 +- console/pom.xml | 14 -- .../controller/NamespaceController.java | 4 +- .../controller/PermissionController.java | 4 +- .../console/controller/RoleController.java | 4 +- .../console/controller/UserController.java | 10 +- .../exception/ConsoleExceptionHandler.java | 2 +- .../security/nacos/JwtTokenManager.java | 13 +- .../security/nacos/NacosAuthConfig.java | 4 +- .../security/nacos/NacosAuthManager.java | 8 +- .../nacos/roles/NacosRoleServiceImpl.java | 4 +- .../security/nacos/users/NacosUser.java | 2 +- .../users/NacosUserDetailsServiceImpl.java | 2 +- .../static/console-fe/src/locales/en-US.js | 2 + .../static/console-fe/src/locales/zh-CN.js | 2 + .../ConfigurationManagement.js | 7 +- console/src/main/resources/static/js/main.js | 4 +- .../controller/UserControllerTest.java | 6 +- core/pom.xml | 15 -- .../alibaba/nacos/core/auth/AuthConfig.java | 46 +++++ .../alibaba/nacos/core/auth/AuthFilter.java | 6 + .../nacos/core/exception/ErrorCode.java | 40 ++-- ...Exception.java => KVStorageException.java} | 22 ++- .../nacos/core/storage/StorageFactory.java | 43 +++++ .../nacos/core/storage/kv/FileKVStorage.java | 175 ++++++++++++++++++ .../nacos/core/storage/kv/KvStorage.java | 114 ++++++++++++ .../core/storage/kv/MemoryKVStorage.java | 129 +++++++++++++ .../storage/{ => kv}/RocksBackupInfo.java | 2 +- .../core/storage/{ => kv}/RocksDBUtils.java | 2 +- .../core/storage/{ => kv}/RocksStorage.java | 156 ++++++---------- .../alibaba/nacos/core/utils/DiskUtils.java | 4 +- .../alibaba/nacos/core/utils/InetUtils.java | 1 - .../nacos/core/storage/RocksStorageTest.java | 7 +- .../impl/NamingSnapshotOperation.java | 8 +- .../impl/PersistentServiceProcessor.java | 22 ++- .../naming/controllers/CatalogController.java | 4 +- .../naming/controllers/ClusterController.java | 4 +- .../naming/controllers/HealthController.java | 4 +- .../controllers/InstanceController.java | 4 +- .../controllers/OperatorController.java | 4 +- .../naming/controllers/ServiceController.java | 4 +- .../naming/web/NamingResourceParser.java | 4 +- .../impl/NamingSnapshotOperationTest.java | 2 +- .../test/common/WatchFileCenter_ITCase.java | 6 +- .../nacos/test/core/auth/AuthBase.java | 2 +- .../test/core/auth/Permission_ITCase.java | 2 +- 65 files changed, 825 insertions(+), 282 deletions(-) rename {core/src/main/java/com/alibaba/nacos/core => auth/src/main/java/com/alibaba/nacos}/auth/AuthManager.java (88%) rename {core/src/main/java/com/alibaba/nacos/core/auth => auth/src/main/java/com/alibaba/nacos/auth/annotation}/Secured.java (86%) rename {core/src/main/java/com/alibaba/nacos/core/auth => auth/src/main/java/com/alibaba/nacos/auth/common}/ActionTypes.java (94%) rename {core/src/main/java/com/alibaba/nacos/core/auth => auth/src/main/java/com/alibaba/nacos/auth/common}/AuthConfigs.java (78%) rename {core/src/main/java/com/alibaba/nacos/core/auth => auth/src/main/java/com/alibaba/nacos/auth/common}/AuthSystemTypes.java (93%) rename {core/src/main/java/com/alibaba/nacos/core => auth/src/main/java/com/alibaba/nacos/auth/common}/env/ReloadableConfigs.java (97%) rename {core/src/main/java/com/alibaba/nacos/core/auth => auth/src/main/java/com/alibaba/nacos/auth/exception}/AccessException.java (94%) rename {core/src/main/java/com/alibaba/nacos/core/auth => auth/src/main/java/com/alibaba/nacos/auth/model}/Permission.java (96%) rename {core/src/main/java/com/alibaba/nacos/core/auth => auth/src/main/java/com/alibaba/nacos/auth/model}/Resource.java (96%) rename {core/src/main/java/com/alibaba/nacos/core/auth => auth/src/main/java/com/alibaba/nacos/auth/model}/User.java (95%) rename {core/src/main/java/com/alibaba/nacos/core/auth => auth/src/main/java/com/alibaba/nacos/auth/parser}/DefaultResourceParser.java (94%) rename {core/src/main/java/com/alibaba/nacos/core/auth => auth/src/main/java/com/alibaba/nacos/auth/parser}/ResourceParser.java (94%) create mode 100644 core/src/main/java/com/alibaba/nacos/core/auth/AuthConfig.java rename core/src/main/java/com/alibaba/nacos/core/exception/{RocksStorageException.java => KVStorageException.java} (69%) create mode 100644 core/src/main/java/com/alibaba/nacos/core/storage/StorageFactory.java create mode 100644 core/src/main/java/com/alibaba/nacos/core/storage/kv/FileKVStorage.java create mode 100644 core/src/main/java/com/alibaba/nacos/core/storage/kv/KvStorage.java create mode 100644 core/src/main/java/com/alibaba/nacos/core/storage/kv/MemoryKVStorage.java rename core/src/main/java/com/alibaba/nacos/core/storage/{ => kv}/RocksBackupInfo.java (97%) rename core/src/main/java/com/alibaba/nacos/core/storage/{ => kv}/RocksDBUtils.java (99%) rename core/src/main/java/com/alibaba/nacos/core/storage/{ => kv}/RocksStorage.java (71%) diff --git a/address/src/main/java/com/alibaba/nacos/address/auth/AddressServerAuthManager.java b/address/src/main/java/com/alibaba/nacos/address/auth/AddressServerAuthManager.java index fb7c08b98..617cd232d 100644 --- a/address/src/main/java/com/alibaba/nacos/address/auth/AddressServerAuthManager.java +++ b/address/src/main/java/com/alibaba/nacos/address/auth/AddressServerAuthManager.java @@ -16,10 +16,10 @@ package com.alibaba.nacos.address.auth; -import com.alibaba.nacos.core.auth.AccessException; -import com.alibaba.nacos.core.auth.AuthManager; -import com.alibaba.nacos.core.auth.Permission; -import com.alibaba.nacos.core.auth.User; +import com.alibaba.nacos.auth.AuthManager; +import com.alibaba.nacos.auth.exception.AccessException; +import com.alibaba.nacos.auth.model.Permission; +import com.alibaba.nacos.auth.model.User; /** * Address server auth manager. diff --git a/address/src/main/java/com/alibaba/nacos/address/configuration/AddressServerSpringConfiguration.java b/address/src/main/java/com/alibaba/nacos/address/configuration/AddressServerSpringConfiguration.java index bd822b1ce..8c04df237 100644 --- a/address/src/main/java/com/alibaba/nacos/address/configuration/AddressServerSpringConfiguration.java +++ b/address/src/main/java/com/alibaba/nacos/address/configuration/AddressServerSpringConfiguration.java @@ -17,7 +17,7 @@ package com.alibaba.nacos.address.configuration; import com.alibaba.nacos.address.auth.AddressServerAuthManager; -import com.alibaba.nacos.core.auth.AuthManager; +import com.alibaba.nacos.auth.AuthManager; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/auth/pom.xml b/auth/pom.xml index 0653a75e7..a048b81cf 100644 --- a/auth/pom.xml +++ b/auth/pom.xml @@ -36,7 +36,36 @@ + + ${project.groupId} + nacos-common + + + + org.springframework.boot + spring-boot-starter + true + + + org.apache.tomcat.embed + tomcat-embed-core + + + + io.jsonwebtoken + jjwt-api + + + io.jsonwebtoken + jjwt-impl + runtime + + + io.jsonwebtoken + jjwt-jackson + runtime + diff --git a/core/src/main/java/com/alibaba/nacos/core/auth/AuthManager.java b/auth/src/main/java/com/alibaba/nacos/auth/AuthManager.java similarity index 88% rename from core/src/main/java/com/alibaba/nacos/core/auth/AuthManager.java rename to auth/src/main/java/com/alibaba/nacos/auth/AuthManager.java index b1cfaeea8..0009e0569 100644 --- a/core/src/main/java/com/alibaba/nacos/core/auth/AuthManager.java +++ b/auth/src/main/java/com/alibaba/nacos/auth/AuthManager.java @@ -14,12 +14,17 @@ * limitations under the License. */ -package com.alibaba.nacos.core.auth; +package com.alibaba.nacos.auth; + +import com.alibaba.nacos.auth.exception.AccessException; +import com.alibaba.nacos.auth.model.Permission; +import com.alibaba.nacos.auth.model.User; /** * Access control entry. Can be extended by 3rd party implementations. * * @author nkorange + * @author mai.jh * @since 1.2.0 */ public interface AuthManager { diff --git a/core/src/main/java/com/alibaba/nacos/core/auth/Secured.java b/auth/src/main/java/com/alibaba/nacos/auth/annotation/Secured.java similarity index 86% rename from core/src/main/java/com/alibaba/nacos/core/auth/Secured.java rename to auth/src/main/java/com/alibaba/nacos/auth/annotation/Secured.java index 2b129f055..06e53bba8 100644 --- a/core/src/main/java/com/alibaba/nacos/core/auth/Secured.java +++ b/auth/src/main/java/com/alibaba/nacos/auth/annotation/Secured.java @@ -14,8 +14,11 @@ * limitations under the License. */ -package com.alibaba.nacos.core.auth; +package com.alibaba.nacos.auth.annotation; +import com.alibaba.nacos.auth.common.ActionTypes; +import com.alibaba.nacos.auth.parser.DefaultResourceParser; +import com.alibaba.nacos.auth.parser.ResourceParser; import org.apache.commons.lang3.StringUtils; import java.lang.annotation.Retention; @@ -25,6 +28,7 @@ import java.lang.annotation.RetentionPolicy; * Annotation indicating that the annotated request should be authorized. * * @author nkorange + * @author mai.jh * @since 1.2.0 */ @Retention(RetentionPolicy.RUNTIME) diff --git a/core/src/main/java/com/alibaba/nacos/core/auth/ActionTypes.java b/auth/src/main/java/com/alibaba/nacos/auth/common/ActionTypes.java similarity index 94% rename from core/src/main/java/com/alibaba/nacos/core/auth/ActionTypes.java rename to auth/src/main/java/com/alibaba/nacos/auth/common/ActionTypes.java index 4cace580b..77157b61f 100644 --- a/core/src/main/java/com/alibaba/nacos/core/auth/ActionTypes.java +++ b/auth/src/main/java/com/alibaba/nacos/auth/common/ActionTypes.java @@ -14,12 +14,13 @@ * limitations under the License. */ -package com.alibaba.nacos.core.auth; +package com.alibaba.nacos.auth.common; /** * Resource action type definitions. * * @author nkorange + * @author mai.jh * @since 1.2.0 */ public enum ActionTypes { diff --git a/core/src/main/java/com/alibaba/nacos/core/auth/AuthConfigs.java b/auth/src/main/java/com/alibaba/nacos/auth/common/AuthConfigs.java similarity index 78% rename from core/src/main/java/com/alibaba/nacos/core/auth/AuthConfigs.java rename to auth/src/main/java/com/alibaba/nacos/auth/common/AuthConfigs.java index a8b928712..19638654b 100644 --- a/core/src/main/java/com/alibaba/nacos/core/auth/AuthConfigs.java +++ b/auth/src/main/java/com/alibaba/nacos/auth/common/AuthConfigs.java @@ -14,18 +14,16 @@ * limitations under the License. */ -package com.alibaba.nacos.core.auth; +package com.alibaba.nacos.auth.common; +import com.alibaba.nacos.auth.common.env.ReloadableConfigs; import com.alibaba.nacos.common.JustForTest; -import com.alibaba.nacos.core.env.ReloadableConfigs; +import io.jsonwebtoken.io.Decoders; import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.web.servlet.FilterRegistrationBean; -import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.stereotype.Component; import java.util.Objects; @@ -33,9 +31,9 @@ import java.util.Objects; * Auth related configurations. * * @author nkorange + * @author mai.jh * @since 1.2.0 */ -@Component @Configuration public class AuthConfigs { @@ -51,6 +49,11 @@ public class AuthConfigs { @Value("${nacos.core.auth.default.token.secret.key:}") private String secretKey; + /** + * secret key byte array. + */ + private byte[] secretKeyBytes; + /** * Token validity time(seconds). */ @@ -63,8 +66,11 @@ public class AuthConfigs { @Value("${nacos.core.auth.system.type:}") private String nacosAuthSystemType; - public String getSecretKey() { - return secretKey; + public byte[] getSecretKeyBytes() { + if (secretKeyBytes == null) { + secretKeyBytes = Decoders.BASE64.decode(secretKey); + } + return secretKeyBytes; } public long getTokenValidityInSeconds() { @@ -107,21 +113,4 @@ public class AuthConfigs { public static void setCachingEnabled(boolean cachingEnabled) { AuthConfigs.cachingEnabled = cachingEnabled; } - - @Bean - public FilterRegistrationBean authFilterRegistration() { - FilterRegistrationBean registration = new FilterRegistrationBean<>(); - registration.setFilter(authFilter()); - registration.addUrlPatterns("/*"); - registration.setName("authFilter"); - registration.setOrder(6); - - return registration; - } - - @Bean - public AuthFilter authFilter() { - return new AuthFilter(); - } - } diff --git a/core/src/main/java/com/alibaba/nacos/core/auth/AuthSystemTypes.java b/auth/src/main/java/com/alibaba/nacos/auth/common/AuthSystemTypes.java similarity index 93% rename from core/src/main/java/com/alibaba/nacos/core/auth/AuthSystemTypes.java rename to auth/src/main/java/com/alibaba/nacos/auth/common/AuthSystemTypes.java index 2517b5bbc..dc45b50e3 100644 --- a/core/src/main/java/com/alibaba/nacos/core/auth/AuthSystemTypes.java +++ b/auth/src/main/java/com/alibaba/nacos/auth/common/AuthSystemTypes.java @@ -14,12 +14,13 @@ * limitations under the License. */ -package com.alibaba.nacos.core.auth; +package com.alibaba.nacos.auth.common; /** * Types of all auth implementations. * * @author nkorange + * @author mai.jh * @since 1.2.0 */ public enum AuthSystemTypes { diff --git a/core/src/main/java/com/alibaba/nacos/core/env/ReloadableConfigs.java b/auth/src/main/java/com/alibaba/nacos/auth/common/env/ReloadableConfigs.java similarity index 97% rename from core/src/main/java/com/alibaba/nacos/core/env/ReloadableConfigs.java rename to auth/src/main/java/com/alibaba/nacos/auth/common/env/ReloadableConfigs.java index 32d704a37..6984ad52e 100644 --- a/core/src/main/java/com/alibaba/nacos/core/env/ReloadableConfigs.java +++ b/auth/src/main/java/com/alibaba/nacos/auth/common/env/ReloadableConfigs.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.alibaba.nacos.core.env; +package com.alibaba.nacos.auth.common.env; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Value; @@ -31,6 +31,7 @@ import java.util.Properties; * Reload application.properties. * * @author nkorange + * @author mai.jh * @since 1.2.0 */ @Component diff --git a/core/src/main/java/com/alibaba/nacos/core/auth/AccessException.java b/auth/src/main/java/com/alibaba/nacos/auth/exception/AccessException.java similarity index 94% rename from core/src/main/java/com/alibaba/nacos/core/auth/AccessException.java rename to auth/src/main/java/com/alibaba/nacos/auth/exception/AccessException.java index 50b5b581f..e53574d72 100644 --- a/core/src/main/java/com/alibaba/nacos/core/auth/AccessException.java +++ b/auth/src/main/java/com/alibaba/nacos/auth/exception/AccessException.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.alibaba.nacos.core.auth; +package com.alibaba.nacos.auth.exception; import com.alibaba.nacos.api.exception.NacosException; @@ -22,6 +22,7 @@ import com.alibaba.nacos.api.exception.NacosException; * Exception to be thrown if authorization is failed. * * @author nkorange + * @author mai.jh * @since 1.2.0 */ public class AccessException extends NacosException { diff --git a/core/src/main/java/com/alibaba/nacos/core/auth/Permission.java b/auth/src/main/java/com/alibaba/nacos/auth/model/Permission.java similarity index 96% rename from core/src/main/java/com/alibaba/nacos/core/auth/Permission.java rename to auth/src/main/java/com/alibaba/nacos/auth/model/Permission.java index 9e3ca3347..cf30a5ecf 100644 --- a/core/src/main/java/com/alibaba/nacos/core/auth/Permission.java +++ b/auth/src/main/java/com/alibaba/nacos/auth/model/Permission.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.alibaba.nacos.core.auth; +package com.alibaba.nacos.auth.model; import java.io.Serializable; @@ -22,6 +22,7 @@ import java.io.Serializable; * Permission to auth. * * @author nkorange + * @author mai.jh * @since 1.2.0 */ public class Permission implements Serializable { diff --git a/core/src/main/java/com/alibaba/nacos/core/auth/Resource.java b/auth/src/main/java/com/alibaba/nacos/auth/model/Resource.java similarity index 96% rename from core/src/main/java/com/alibaba/nacos/core/auth/Resource.java rename to auth/src/main/java/com/alibaba/nacos/auth/model/Resource.java index 74a9bb5d9..fa15feddf 100644 --- a/core/src/main/java/com/alibaba/nacos/core/auth/Resource.java +++ b/auth/src/main/java/com/alibaba/nacos/auth/model/Resource.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.alibaba.nacos.core.auth; +package com.alibaba.nacos.auth.model; import java.io.Serializable; @@ -22,6 +22,7 @@ import java.io.Serializable; * Resource used in authorization. * * @author nkorange + * @author mai.jh * @since 1.2.0 */ public class Resource implements Serializable { diff --git a/core/src/main/java/com/alibaba/nacos/core/auth/User.java b/auth/src/main/java/com/alibaba/nacos/auth/model/User.java similarity index 95% rename from core/src/main/java/com/alibaba/nacos/core/auth/User.java rename to auth/src/main/java/com/alibaba/nacos/auth/model/User.java index 806cb8bee..0db4fd7ab 100644 --- a/core/src/main/java/com/alibaba/nacos/core/auth/User.java +++ b/auth/src/main/java/com/alibaba/nacos/auth/model/User.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.alibaba.nacos.core.auth; +package com.alibaba.nacos.auth.model; import java.io.Serializable; @@ -22,6 +22,7 @@ import java.io.Serializable; * User information in authorization. * * @author nkorange + * @author mai.jh * @since 1.2.0 */ public class User implements Serializable { diff --git a/core/src/main/java/com/alibaba/nacos/core/auth/DefaultResourceParser.java b/auth/src/main/java/com/alibaba/nacos/auth/parser/DefaultResourceParser.java similarity index 94% rename from core/src/main/java/com/alibaba/nacos/core/auth/DefaultResourceParser.java rename to auth/src/main/java/com/alibaba/nacos/auth/parser/DefaultResourceParser.java index 86d36645a..dcc1699fa 100644 --- a/core/src/main/java/com/alibaba/nacos/core/auth/DefaultResourceParser.java +++ b/auth/src/main/java/com/alibaba/nacos/auth/parser/DefaultResourceParser.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.alibaba.nacos.core.auth; +package com.alibaba.nacos.auth.parser; import org.apache.commons.lang3.StringUtils; @@ -22,6 +22,7 @@ import org.apache.commons.lang3.StringUtils; * Default resource parser. * * @author nkorange + * @author mai.jh * @since 1.2.0 */ public class DefaultResourceParser implements ResourceParser { diff --git a/core/src/main/java/com/alibaba/nacos/core/auth/ResourceParser.java b/auth/src/main/java/com/alibaba/nacos/auth/parser/ResourceParser.java similarity index 94% rename from core/src/main/java/com/alibaba/nacos/core/auth/ResourceParser.java rename to auth/src/main/java/com/alibaba/nacos/auth/parser/ResourceParser.java index b86a1e089..9902aa1ef 100644 --- a/core/src/main/java/com/alibaba/nacos/core/auth/ResourceParser.java +++ b/auth/src/main/java/com/alibaba/nacos/auth/parser/ResourceParser.java @@ -14,12 +14,13 @@ * limitations under the License. */ -package com.alibaba.nacos.core.auth; +package com.alibaba.nacos.auth.parser; /** * Resource parser. * * @author nkorange + * @author mai.jh * @since 1.2.0 */ public interface ResourceParser { diff --git a/client/src/test/java/com/alibaba/nacos/client/ConfigTest.java b/client/src/test/java/com/alibaba/nacos/client/ConfigTest.java index 2789fcb39..b9a5f7734 100644 --- a/client/src/test/java/com/alibaba/nacos/client/ConfigTest.java +++ b/client/src/test/java/com/alibaba/nacos/client/ConfigTest.java @@ -20,6 +20,7 @@ import com.alibaba.nacos.api.NacosFactory; import com.alibaba.nacos.api.PropertyKeyConst; import com.alibaba.nacos.api.config.ConfigService; import com.alibaba.nacos.api.config.listener.AbstractListener; +import com.alibaba.nacos.api.exception.NacosException; import com.alibaba.nacos.common.utils.ThreadUtils; import org.junit.After; import org.junit.Assert; @@ -28,7 +29,7 @@ import org.junit.Ignore; import org.junit.Test; import java.util.Properties; -import java.util.Scanner; +import java.util.concurrent.atomic.AtomicBoolean; @Ignore public class ConfigTest { @@ -36,7 +37,7 @@ public class ConfigTest { private static ConfigService configService; @Before - public static void before() throws Exception { + public void before() throws Exception { Properties properties = new Properties(); properties.setProperty(PropertyKeyConst.SERVER_ADDR, "127.0.0.1:8848"); configService = NacosFactory.createConfigService(properties); @@ -48,7 +49,8 @@ public class ConfigTest { } @Test - public static void test() throws Exception { + public void test() throws Exception { + // set config final String dataId = "lessspring"; final String group = "lessspring"; final String content = "lessspring-" + System.currentTimeMillis(); @@ -57,24 +59,46 @@ public class ConfigTest { ThreadUtils.sleep(10000L); + // set change listener + final AtomicBoolean hasListener = new AtomicBoolean(false); + final AtomicBoolean hasChangedCallback = new AtomicBoolean(false); + final String[] changedTmpContent = {""}; String response = configService.getConfigAndSignListener(dataId, group, 5000, new AbstractListener() { @Override public void receiveConfigInfo(String configInfo) { - System.err.println(configInfo); + System.out.println("receiveConfigInfo:" + configInfo); + changedTmpContent[0] = configInfo; + hasChangedCallback.set(true); } }); + hasListener.set(true); Assert.assertEquals(content, response); - Scanner scanner = new Scanner(System.in); - System.out.println("input content"); - while (scanner.hasNextLine()) { - String s = scanner.next(); - if ("exit".equals(s)) { - scanner.close(); - return; + // new thread to publish config + final String newRawContent = "nacosnewconfig-" + System.currentTimeMillis(); + new Thread(new Runnable() { + @Override + public void run() { + while (hasListener.get()) { + try { + configService.publishConfig(dataId, group, newRawContent); + hasListener.set(false); + break; + } catch (NacosException e) { + e.printStackTrace(); + } + } } - configService.publishConfig(dataId, group, s); - } + }).start(); + + // spin + do { + if (hasChangedCallback.get()) { + System.out.println(newRawContent + "==> " + changedTmpContent[0]); + Assert.assertEquals(newRawContent, changedTmpContent[0]); + break; + } + } while (!hasChangedCallback.get()); } } diff --git a/config/src/main/java/com/alibaba/nacos/config/server/auth/ConfigResourceParser.java b/config/src/main/java/com/alibaba/nacos/config/server/auth/ConfigResourceParser.java index 4bfc266ac..bf31875ed 100644 --- a/config/src/main/java/com/alibaba/nacos/config/server/auth/ConfigResourceParser.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/auth/ConfigResourceParser.java @@ -16,11 +16,10 @@ package com.alibaba.nacos.config.server.auth; -import com.alibaba.nacos.core.auth.Resource; -import com.alibaba.nacos.core.auth.ResourceParser; - import javax.servlet.http.HttpServletRequest; +import com.alibaba.nacos.auth.model.Resource; +import com.alibaba.nacos.auth.parser.ResourceParser; import org.apache.commons.lang3.StringUtils; /** 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 812b93cab..be8505eed 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 @@ -17,6 +17,8 @@ package com.alibaba.nacos.config.server.controller; import com.alibaba.nacos.api.exception.NacosException; +import com.alibaba.nacos.auth.annotation.Secured; +import com.alibaba.nacos.auth.common.ActionTypes; import com.alibaba.nacos.common.model.RestResult; import com.alibaba.nacos.common.utils.MapUtils; import com.alibaba.nacos.config.server.auth.ConfigResourceParser; @@ -43,8 +45,6 @@ import com.alibaba.nacos.config.server.utils.ParamUtils; import com.alibaba.nacos.config.server.utils.RequestUtil; import com.alibaba.nacos.config.server.utils.TimeUtils; import com.alibaba.nacos.config.server.utils.ZipUtils; -import com.alibaba.nacos.core.auth.ActionTypes; -import com.alibaba.nacos.core.auth.Secured; import com.alibaba.nacos.core.utils.InetUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateFormatUtils; diff --git a/config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigOpsController.java b/config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigOpsController.java index cb7728c06..54bf19c23 100755 --- a/config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigOpsController.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigOpsController.java @@ -16,6 +16,8 @@ package com.alibaba.nacos.config.server.controller; +import com.alibaba.nacos.auth.annotation.Secured; +import com.alibaba.nacos.auth.common.ActionTypes; import com.alibaba.nacos.common.model.RestResult; import com.alibaba.nacos.common.model.RestResultUtils; import com.alibaba.nacos.common.utils.Objects; @@ -29,8 +31,6 @@ import com.alibaba.nacos.config.server.service.repository.PersistService; import com.alibaba.nacos.config.server.service.repository.embedded.DatabaseOperate; import com.alibaba.nacos.config.server.utils.LogUtil; import com.alibaba.nacos.config.server.utils.PropertyUtil; -import com.alibaba.nacos.core.auth.ActionTypes; -import com.alibaba.nacos.core.auth.Secured; import com.alibaba.nacos.core.utils.ApplicationUtils; import com.alibaba.nacos.core.utils.WebUtils; import org.apache.commons.lang3.StringUtils; 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 e6ca390f9..834d4dcae 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 @@ -16,7 +16,7 @@ package com.alibaba.nacos.config.server.utils; -import com.alibaba.nacos.core.auth.User; +import com.alibaba.nacos.auth.model.User; import org.apache.commons.lang3.StringUtils; import javax.servlet.http.HttpServletRequest; diff --git a/console/pom.xml b/console/pom.xml index 571f26691..b86ea9358 100644 --- a/console/pom.xml +++ b/console/pom.xml @@ -76,20 +76,6 @@ org.springframework.boot spring-boot-starter-security - - io.jsonwebtoken - jjwt-api - - - io.jsonwebtoken - jjwt-impl - runtime - - - io.jsonwebtoken - jjwt-jackson - runtime - 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 efd441cab..d0ca0fe3e 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 @@ -16,14 +16,14 @@ package com.alibaba.nacos.console.controller; +import com.alibaba.nacos.auth.annotation.Secured; +import com.alibaba.nacos.auth.common.ActionTypes; import com.alibaba.nacos.common.model.RestResult; import com.alibaba.nacos.config.server.model.TenantInfo; import com.alibaba.nacos.config.server.service.repository.PersistService; import com.alibaba.nacos.console.model.Namespace; import com.alibaba.nacos.console.model.NamespaceAllInfo; import com.alibaba.nacos.console.security.nacos.NacosAuthConfig; -import com.alibaba.nacos.core.auth.ActionTypes; -import com.alibaba.nacos.core.auth.Secured; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.DeleteMapping; diff --git a/console/src/main/java/com/alibaba/nacos/console/controller/PermissionController.java b/console/src/main/java/com/alibaba/nacos/console/controller/PermissionController.java index 4730fa1be..d808009f3 100644 --- a/console/src/main/java/com/alibaba/nacos/console/controller/PermissionController.java +++ b/console/src/main/java/com/alibaba/nacos/console/controller/PermissionController.java @@ -16,11 +16,11 @@ package com.alibaba.nacos.console.controller; +import com.alibaba.nacos.auth.annotation.Secured; +import com.alibaba.nacos.auth.common.ActionTypes; import com.alibaba.nacos.common.model.RestResult; import com.alibaba.nacos.console.security.nacos.NacosAuthConfig; import com.alibaba.nacos.console.security.nacos.roles.NacosRoleServiceImpl; -import com.alibaba.nacos.core.auth.ActionTypes; -import com.alibaba.nacos.core.auth.Secured; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.DeleteMapping; diff --git a/console/src/main/java/com/alibaba/nacos/console/controller/RoleController.java b/console/src/main/java/com/alibaba/nacos/console/controller/RoleController.java index f89e691b8..6592ed39f 100644 --- a/console/src/main/java/com/alibaba/nacos/console/controller/RoleController.java +++ b/console/src/main/java/com/alibaba/nacos/console/controller/RoleController.java @@ -16,11 +16,11 @@ package com.alibaba.nacos.console.controller; +import com.alibaba.nacos.auth.annotation.Secured; +import com.alibaba.nacos.auth.common.ActionTypes; import com.alibaba.nacos.common.model.RestResult; import com.alibaba.nacos.console.security.nacos.NacosAuthConfig; import com.alibaba.nacos.console.security.nacos.roles.NacosRoleServiceImpl; -import com.alibaba.nacos.core.auth.ActionTypes; -import com.alibaba.nacos.core.auth.Secured; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.DeleteMapping; diff --git a/console/src/main/java/com/alibaba/nacos/console/controller/UserController.java b/console/src/main/java/com/alibaba/nacos/console/controller/UserController.java index 13562dfa2..c9f391159 100644 --- a/console/src/main/java/com/alibaba/nacos/console/controller/UserController.java +++ b/console/src/main/java/com/alibaba/nacos/console/controller/UserController.java @@ -17,6 +17,11 @@ package com.alibaba.nacos.console.controller; import com.alibaba.nacos.api.common.Constants; +import com.alibaba.nacos.auth.annotation.Secured; +import com.alibaba.nacos.auth.common.ActionTypes; +import com.alibaba.nacos.auth.common.AuthConfigs; +import com.alibaba.nacos.auth.common.AuthSystemTypes; +import com.alibaba.nacos.auth.exception.AccessException; import com.alibaba.nacos.common.model.RestResult; import com.alibaba.nacos.common.utils.JacksonUtils; import com.alibaba.nacos.config.server.auth.RoleInfo; @@ -28,11 +33,6 @@ import com.alibaba.nacos.console.security.nacos.users.NacosUser; import com.alibaba.nacos.console.security.nacos.users.NacosUserDetailsServiceImpl; import com.alibaba.nacos.console.utils.JwtTokenUtils; import com.alibaba.nacos.console.utils.PasswordEncoderUtil; -import com.alibaba.nacos.core.auth.AccessException; -import com.alibaba.nacos.core.auth.ActionTypes; -import com.alibaba.nacos.core.auth.AuthConfigs; -import com.alibaba.nacos.core.auth.AuthSystemTypes; -import com.alibaba.nacos.core.auth.Secured; import com.fasterxml.jackson.databind.node.ObjectNode; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.authentication.AuthenticationManager; diff --git a/console/src/main/java/com/alibaba/nacos/console/exception/ConsoleExceptionHandler.java b/console/src/main/java/com/alibaba/nacos/console/exception/ConsoleExceptionHandler.java index 7853593a7..d76080c45 100644 --- a/console/src/main/java/com/alibaba/nacos/console/exception/ConsoleExceptionHandler.java +++ b/console/src/main/java/com/alibaba/nacos/console/exception/ConsoleExceptionHandler.java @@ -16,8 +16,8 @@ package com.alibaba.nacos.console.exception; +import com.alibaba.nacos.auth.exception.AccessException; import com.alibaba.nacos.common.utils.ExceptionUtil; -import com.alibaba.nacos.core.auth.AccessException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpStatus; diff --git a/console/src/main/java/com/alibaba/nacos/console/security/nacos/JwtTokenManager.java b/console/src/main/java/com/alibaba/nacos/console/security/nacos/JwtTokenManager.java index 9d42a2a4c..b40c34d8b 100644 --- a/console/src/main/java/com/alibaba/nacos/console/security/nacos/JwtTokenManager.java +++ b/console/src/main/java/com/alibaba/nacos/console/security/nacos/JwtTokenManager.java @@ -16,10 +16,11 @@ package com.alibaba.nacos.console.security.nacos; -import com.alibaba.nacos.core.auth.AuthConfigs; +import com.alibaba.nacos.auth.common.AuthConfigs; import io.jsonwebtoken.Claims; import io.jsonwebtoken.Jwts; import io.jsonwebtoken.SignatureAlgorithm; +import io.jsonwebtoken.security.Keys; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; @@ -69,9 +70,8 @@ public class JwtTokenManager { validity = new Date(now + authConfigs.getTokenValidityInSeconds() * 1000L); Claims claims = Jwts.claims().setSubject(userName); - return Jwts.builder().setClaims(claims).setExpiration(validity) - .signWith(SignatureAlgorithm.HS256, authConfigs.getSecretKey()).compact(); + .signWith(Keys.hmacShaKeyFor(authConfigs.getSecretKeyBytes()), SignatureAlgorithm.HS256).compact(); } /** @@ -81,8 +81,8 @@ public class JwtTokenManager { * @return auth info */ public Authentication getAuthentication(String token) { - - Claims claims = Jwts.parser().setSigningKey(authConfigs.getSecretKey()).parseClaimsJws(token).getBody(); + Claims claims = Jwts.parserBuilder().setSigningKey(authConfigs.getSecretKeyBytes()).build() + .parseClaimsJws(token).getBody(); List authorities = AuthorityUtils .commaSeparatedStringToAuthorityList((String) claims.get(AUTHORITIES_KEY)); @@ -97,6 +97,7 @@ public class JwtTokenManager { * @param token token */ public void validateToken(String token) { - Jwts.parser().setSigningKey(authConfigs.getSecretKey()).parseClaimsJws(token); + Jwts.parserBuilder().setSigningKey(authConfigs.getSecretKeyBytes()).build().parseClaimsJws(token); } + } diff --git a/console/src/main/java/com/alibaba/nacos/console/security/nacos/NacosAuthConfig.java b/console/src/main/java/com/alibaba/nacos/console/security/nacos/NacosAuthConfig.java index 7956420b9..b06826bae 100644 --- a/console/src/main/java/com/alibaba/nacos/console/security/nacos/NacosAuthConfig.java +++ b/console/src/main/java/com/alibaba/nacos/console/security/nacos/NacosAuthConfig.java @@ -16,10 +16,10 @@ package com.alibaba.nacos.console.security.nacos; +import com.alibaba.nacos.auth.common.AuthConfigs; +import com.alibaba.nacos.auth.common.AuthSystemTypes; import com.alibaba.nacos.console.filter.JwtAuthenticationTokenFilter; import com.alibaba.nacos.console.security.nacos.users.NacosUserDetailsServiceImpl; -import com.alibaba.nacos.core.auth.AuthConfigs; -import com.alibaba.nacos.core.auth.AuthSystemTypes; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; diff --git a/console/src/main/java/com/alibaba/nacos/console/security/nacos/NacosAuthManager.java b/console/src/main/java/com/alibaba/nacos/console/security/nacos/NacosAuthManager.java index c35fcc861..8a7b80db0 100644 --- a/console/src/main/java/com/alibaba/nacos/console/security/nacos/NacosAuthManager.java +++ b/console/src/main/java/com/alibaba/nacos/console/security/nacos/NacosAuthManager.java @@ -17,14 +17,14 @@ package com.alibaba.nacos.console.security.nacos; import com.alibaba.nacos.api.common.Constants; +import com.alibaba.nacos.auth.AuthManager; +import com.alibaba.nacos.auth.exception.AccessException; +import com.alibaba.nacos.auth.model.Permission; +import com.alibaba.nacos.auth.model.User; import com.alibaba.nacos.config.server.auth.RoleInfo; import com.alibaba.nacos.config.server.utils.RequestUtil; import com.alibaba.nacos.console.security.nacos.roles.NacosRoleServiceImpl; import com.alibaba.nacos.console.security.nacos.users.NacosUser; -import com.alibaba.nacos.core.auth.AccessException; -import com.alibaba.nacos.core.auth.AuthManager; -import com.alibaba.nacos.core.auth.Permission; -import com.alibaba.nacos.core.auth.User; import com.alibaba.nacos.core.utils.Loggers; import io.jsonwebtoken.ExpiredJwtException; import org.apache.commons.lang3.StringUtils; diff --git a/console/src/main/java/com/alibaba/nacos/console/security/nacos/roles/NacosRoleServiceImpl.java b/console/src/main/java/com/alibaba/nacos/console/security/nacos/roles/NacosRoleServiceImpl.java index 2b64fcb92..d2aff9036 100644 --- a/console/src/main/java/com/alibaba/nacos/console/security/nacos/roles/NacosRoleServiceImpl.java +++ b/console/src/main/java/com/alibaba/nacos/console/security/nacos/roles/NacosRoleServiceImpl.java @@ -16,6 +16,8 @@ package com.alibaba.nacos.console.security.nacos.roles; +import com.alibaba.nacos.auth.common.AuthConfigs; +import com.alibaba.nacos.auth.model.Permission; import com.alibaba.nacos.config.server.auth.PermissionInfo; import com.alibaba.nacos.config.server.auth.PermissionPersistService; import com.alibaba.nacos.config.server.auth.RoleInfo; @@ -23,8 +25,6 @@ import com.alibaba.nacos.config.server.auth.RolePersistService; import com.alibaba.nacos.config.server.model.Page; import com.alibaba.nacos.console.security.nacos.NacosAuthConfig; import com.alibaba.nacos.console.security.nacos.users.NacosUserDetailsServiceImpl; -import com.alibaba.nacos.core.auth.AuthConfigs; -import com.alibaba.nacos.core.auth.Permission; import com.alibaba.nacos.core.utils.Loggers; import io.jsonwebtoken.lang.Collections; import org.apache.commons.lang3.StringUtils; diff --git a/console/src/main/java/com/alibaba/nacos/console/security/nacos/users/NacosUser.java b/console/src/main/java/com/alibaba/nacos/console/security/nacos/users/NacosUser.java index d0aaf196b..8113ae948 100644 --- a/console/src/main/java/com/alibaba/nacos/console/security/nacos/users/NacosUser.java +++ b/console/src/main/java/com/alibaba/nacos/console/security/nacos/users/NacosUser.java @@ -16,7 +16,7 @@ package com.alibaba.nacos.console.security.nacos.users; -import com.alibaba.nacos.core.auth.User; +import com.alibaba.nacos.auth.model.User; /** * Nacos User. diff --git a/console/src/main/java/com/alibaba/nacos/console/security/nacos/users/NacosUserDetailsServiceImpl.java b/console/src/main/java/com/alibaba/nacos/console/security/nacos/users/NacosUserDetailsServiceImpl.java index b899feff6..3f8457d24 100644 --- a/console/src/main/java/com/alibaba/nacos/console/security/nacos/users/NacosUserDetailsServiceImpl.java +++ b/console/src/main/java/com/alibaba/nacos/console/security/nacos/users/NacosUserDetailsServiceImpl.java @@ -16,10 +16,10 @@ package com.alibaba.nacos.console.security.nacos.users; +import com.alibaba.nacos.auth.common.AuthConfigs; import com.alibaba.nacos.config.server.auth.UserPersistService; import com.alibaba.nacos.config.server.model.Page; import com.alibaba.nacos.config.server.model.User; -import com.alibaba.nacos.core.auth.AuthConfigs; import com.alibaba.nacos.core.utils.Loggers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; 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 c3642de8a..c9bf0db77 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 @@ -309,6 +309,7 @@ const I18N_CONF = { cloneSuccEnd: 'configuration items cloned', cloneFail: 'Clone failed', getNamespaceFailed: 'get the namespace failed', + getNamespace403: 'Without permission to access ${namespaceName} namespace!', startCloning: 'Start Clone', cloningConfiguration: 'Clone config', source: 'Source :', @@ -322,6 +323,7 @@ const I18N_CONF = { delSelectedAlertContent: 'please select the configuration to delete', delSuccessMsg: 'delete successful', cloneEditableTitle: 'Modify Data Id and Group (optional)', + authFail: 'Auth failed', }, 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 400a0f1b8..d1e6a82e9 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 @@ -307,6 +307,7 @@ const I18N_CONF = { cloneSuccEnd: '项配置', cloneFail: '克隆失败', getNamespaceFailed: '获取命名空间失败', + getNamespace403: '没有 ${namespaceName} 命名空间的访问权限!', startCloning: '开始克隆', cloningConfiguration: '克隆配置', source: '源空间:', @@ -320,6 +321,7 @@ const I18N_CONF = { delSelectedAlertContent: '请选择要删除的配置', delSuccessMsg: '删除成功', cloneEditableTitle: '修改 Data Id 和 Group (可选操作)', + authFail: '权限认证失败', }, 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 bd0ad5598..551eae669 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 @@ -292,8 +292,11 @@ class ConfigurationManagement extends React.Component { }); if (res && [401, 403].includes(res.status)) { Dialog.alert({ - title: locale.importFail, - content: locale.importFail403, + title: locale.authFail, + content: locale.getNamespace403.replace( + '${namespaceName}', + this.state.nownamespace_name + ), }); } }); diff --git a/console/src/main/resources/static/js/main.js b/console/src/main/resources/static/js/main.js index 51384042a..41b16e812 100644 --- a/console/src/main/resources/static/js/main.js +++ b/console/src/main/resources/static/js/main.js @@ -11,7 +11,7 @@ d.version="2.27.0",function(e){t=e}(Gn),d.fn=io,d.min=function(){return $n("isBe Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ -!function(){"use strict";var i={}.hasOwnProperty;function s(){for(var e=[],t=0;t 16.8.0")},h.prototype.validate=function(e,t){this.validateCallback(e,t)},h.prototype.reset=function(e,t){var n=1","Select");var n=u(e,t);return e.onInputUpdate&&(n.onSearch=e.onInputUpdate,n.showSearch=!0),n}}),t.default=a.default.config(r.default,{transform:u,exportNames:["focusInput","handleSearchClear"]}),e.exports=t.default},function(e,t,n){"use strict";n(40),n(506)},function(e,t,n){"use strict";n.d(t,"a",function(){return k}),n.d(t,"b",function(){return T}),n.d(t,"c",function(){return y}),n.d(t,"d",function(){return Y}),n.d(t,"e",function(){return g}),n.d(t,"f",function(){return x}),n.d(t,"g",function(){return P});var a=n(54),r=n(0),u=n.n(r),l=(n(2),n(59)),o=n(168),d=n(55),c=n(34),i=n(169),p=n.n(i),s=(n(124),n(53)),f=n(108),h=n.n(f),m=function(e){var t=Object(o.a)();return t.displayName=e,t}("Router-History"),g=function(e){var t=Object(o.a)();return t.displayName=e,t}("Router"),y=function(n){function e(e){var t=n.call(this,e)||this;return t.state={location:e.history.location},t._isMounted=!1,t._pendingLocation=null,e.staticContext||(t.unlisten=e.history.listen(function(e){t._isMounted?t.setState({location:e}):t._pendingLocation=e})),t}Object(a.a)(e,n),e.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var t=e.prototype;return t.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},t.componentWillUnmount=function(){this.unlisten&&this.unlisten()},t.render=function(){return u.a.createElement(g.Provider,{value:{history:this.props.history,location:this.state.location,match:e.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},u.a.createElement(m.Provider,{children:this.props.children||null,value:this.props.history}))},e}(u.a.Component);u.a.Component;var v=function(e){function t(){return e.apply(this,arguments)||this}Object(a.a)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.props.onMount&&this.props.onMount.call(this,this)},n.componentDidUpdate=function(e){this.props.onUpdate&&this.props.onUpdate.call(this,this,e)},n.componentWillUnmount=function(){this.props.onUnmount&&this.props.onUnmount.call(this,this)},n.render=function(){return null},t}(u.a.Component);var _={},b=1e4,w=0;function M(e,t){return void 0===e&&(e="/"),void 0===t&&(t={}),"/"===e?e:function(e){if(_[e])return _[e];var t=p.a.compile(e);return wt?n.splice(t,n.length-t,a):n.push(a),u({action:"PUSH",location:a,index:t,entries:n}))})},replace:function(e,t){var n=P(e,t,d(),h.location);l.confirmTransitionTo(n,"REPLACE",r,function(e){e&&u({action:"REPLACE",location:h.entries[h.index]=n})})},go:p,goBack:function(){p(-1)},goForward:function(){p(1)},canGo:function(e){var t=h.index+e;return 0<=t&&tx',"Tag"),"readonly"!==n&&"interactive"!==n||r.log.warning("Warning: [ shape="+n+" ] is deprecated at [ Tag ]"),"secondary"===a&&r.log.warning("Warning: [ type=secondary ] is deprecated at [ Tag ]"),["count","marked","value","onChange"].forEach(function(e){e in t&&r.log.warning("Warning: [ "+e+" ] is deprecated at [ Tag ]")}),("selected"in t||"defaultSelected"in t)&&r.log.warning("Warning: [ selected|defaultSelected ] is deprecated at [ Tag ], use [ checked|defaultChecked ] at [ Tag.Selectable ] instead of it"),"closed"in t&&r.log.warning("Warning: [ closed ] is deprecated at [ Tag ], use [ onClose ] at [ Tag.Closeable ] instead of it"),"onSelect"in t&&e("onSelect","","Tag"),"afterClose"in t&&r.log.warning("Warning: [ afterClose ] is deprecated at [ Tag ], use [ afterClose ] at [ Tag.Closeable ] instead of it"),t}});d.Group=a.default.config(i.default),d.Selectable=a.default.config(s.default),d.Closable=a.default.config(l.default),d.Closeable=d.Closable,t.default=d,e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0;var a=o(n(685)),r=o(n(388));function o(e){return e&&e.__esModule?e:{default:e}}a.default.Panel=r.default,t.default=a.default,e.exports=t.default},function(e,t,n){var a=n(85);e.exports=function(e){if(!a(e))throw TypeError(e+" is not an object!");return e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){"use strict";n(40),n(66),n(503)},function(e,t,n){var i=n(334);function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}e.exports=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n,a={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e){Object.prototype.hasOwnProperty.call(e,o)&&((n=r?Object.getOwnPropertyDescriptor(e,o):null)&&(n.get||n.set)?Object.defineProperty(a,o,n):a[o]=e[o])}return a.default=e,t&&t.set(e,a),a}},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var a,r,L=f(n(4)),o=f(n(3)),i=f(n(5)),s=f(n(6)),l=n(0),x=f(l),u=n(24),d=f(n(2)),T=f(n(12)),c=n(11);function f(e){return e&&e.__esModule?e:{default:e}}var p,h=c.func.bindCtx,C=c.obj.pickOthers,m=(p=l.Component,(0,s.default)(D,p),D.prototype.componentDidMount=function(){this.itemNode=(0,u.findDOMNode)(this);var e,t,n,a,r=this.props,o=r.parentMode,i=r.root,s=r.menu;s?this.menuNode=(0,u.findDOMNode)(s):"popup"===o?this.menuNode=this.itemNode.parentNode:(this.menuNode=(0,u.findDOMNode)(i),t=(e=i.props).prefix,n=e.header,a=e.footer,(n||a)&&(this.menuNode=this.menuNode.querySelector("."+t+"menu-content"))),this.setFocus()},D.prototype.componentDidUpdate=function(){this.setFocus()},D.prototype.focusable=function(){var e=this.props,t=e.root,n=e.type,a=e.disabled,r=t.props.focusable;return r&&("submenu"===n||!a)},D.prototype.getFocused=function(){var e=this.props,t=e._key;return e.root.state.focusedKey===t},D.prototype.setFocus=function(){var e;this.getFocused()&&(this.focusable()&&this.itemNode.focus({preventScroll:!0}),this.menuNode&&this.menuNode.scrollHeight>this.menuNode.clientHeight&&(this.menuNode.clientHeight+this.menuNode.scrollTop<(e=this.itemNode.offsetTop+this.itemNode.offsetHeight)?this.menuNode.scrollTop=e-this.menuNode.clientHeight:this.itemNode.offsetTop"===(d=e.charAt(o+1))){r+="(",o++,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 t)a.call(t,n)&&e.push(n);return e}().length},r.subStrCount=function(e,t,n,a){var r,o,i,s,l,u=0;for(e=""+e,t=""+t,null!=n&&(e=e.slice(n)),null!=a&&(e=e.slice(0,a)),i=e.length,l=t.length,r=o=0,s=i;0<=s?o>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,r,o,i,s,l,u,d;if(null==e||!e.length)return null;if(!(o=this.PATTERN_DATE.exec(e)))return null;if(d=parseInt(o.year,10),s=parseInt(o.month,10)-1,n=parseInt(o.day,10),null==o.hour)return t=new Date(Date.UTC(d,s,n));if(r=parseInt(o.hour,10),i=parseInt(o.minute,10),l=parseInt(o.second,10),null!=o.fraction){for(a=o.fraction.slice(0,3);a.length<3;)a+="0";a=parseInt(a,10)}else a=0;return null!=o.tz&&(u=6e4*(60*parseInt(o.tz_hour,10)+(null!=o.tz_minute?parseInt(o.tz_minute,10):0)),"-"===o.tz_sign&&(u*=-1)),t=new Date(Date.UTC(d,s,n,r,i,l,a)),u&&t.setTime(t.getTime()-u),t},r.strRepeat=function(e,t){for(var n="",a=0;ae.length)&&(t=e.length);for(var n=0,a=new Array(t);ndocument.F=Object<\/script>"),e.close(),d=e.F;n--;)delete d[u][s[n]];return d()};e.exports=Object.create||function(e,t){var n;return null!==e?(r[u]=o(e),n=new r,r[u]=null,n[l]=e):n=d(),void 0===t?n:i(n,t)}},function(e,t,n){var a=n(76).f,r=n(77),o=n(87)("toStringTag");e.exports=function(e,t,n){e&&!r(e=n?e:e.prototype,o)&&a(e,o,{configurable:!0,value:t})}},function(e,t,n){t.f=n(87)},function(e,t,n){var a=n(71),r=n(72),o=n(113),i=n(146),s=n(76).f;e.exports=function(e){var t=r.Symbol||(r.Symbol=!o&&a.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:i.f(e)})}},function(e,t,n){"use strict";n(75),n(505)},function(e,t,n){},function(e,t,n){e.exports=n(516)},function(e,t){function l(e,t,n,a,r,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}e.exports=function(s){return function(){var e=this,i=arguments;return new Promise(function(t,n){var a=s.apply(e,i);function r(e){l(a,t,n,r,o,"next",e)}function o(e){l(a,t,n,r,o,"throw",e)}r(void 0)})}}},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(s,e,l){"use strict";(function(e){var n=l(56),a=l(551),t={"Content-Type":"application/x-www-form-urlencoded"};function r(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var o,i={adapter:("undefined"==typeof XMLHttpRequest&&void 0===e||(o=l(347)),o),transformRequest:[function(e,t){return a(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(r(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)?(r(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return 200<=e&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],function(e){i.headers[e]={}}),n.forEach(["post","put","patch"],function(e){i.headers[e]=n.merge(t)}),s.exports=i}).call(this,l(338))},function(e,t,n){"use strict";function s(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},a=0;a>6]+u[128|63&i]:i<55296||57344<=i?r+=u[224|i>>12]+u[128|i>>6&63]+u[128|63&i]:(o+=1,i=65536+((1023&i)<<10|1023&a.charCodeAt(o)),r+=u[240|i>>18]+u[128|i>>12&63]+u[128|i>>6&63]+u[128|63&i])}return r},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(d(e)){for(var n=[],a=0;aa.length&&a.every(function(e,t){return e===n[t]})},t.isAvailablePos=function(e,t,n){var a=n[t],r=a.type,o=a.disabled;return i(e,t)&&("item"===r&&!o||"submenu"===r)});t.getFirstAvaliablelChildKey=function(t,n){var e=Object.keys(n).find(function(e){return a(t+"-0",e,n)});return e?n[e].key:null},t.getChildSelected=function(e){var t=e.selectMode,n=e.selectedKeys,a=e._k2n,r=e._key;if(!a)return!1;var o=(a[r]&&a[r].pos)+"-";return!!t&&n.some(function(e){return a[e]&&0===a[e].pos.indexOf(o)})}},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var a,r,o=d(n(3)),i=d(n(5)),s=d(n(6)),l=d(n(0)),u=d(n(2));function d(e){return e&&e.__esModule?e:{default:e}}var c,f=(c=l.default.Component,(0,s.default)(p,c),p.prototype.render=function(){return null},r=a=p,a.propTypes={dataIndex:u.default.string,cell:u.default.oneOfType([u.default.element,u.default.node,u.default.func]),title:u.default.oneOfType([u.default.element,u.default.node,u.default.func]),htmlTitle:u.default.string,sortable:u.default.bool,width:u.default.oneOfType([u.default.number,u.default.string]),align:u.default.oneOf(["left","center","right"]),alignHeader:u.default.oneOf(["left","center","right"]),filters:u.default.arrayOf(u.default.shape({label:u.default.string,value:u.default.oneOfType([u.default.node,u.default.string])})),filterMode:u.default.oneOf(["single","multiple"]),filterMenuProps:u.default.object,filterProps:u.default.object,lock:u.default.oneOfType([u.default.bool,u.default.string]),resizable:u.default.bool,colSpan:u.default.number},a.contextTypes={parent:u.default.any},a.defaultProps={cell:function(e){return e},filterMode:"multiple",filterMenuProps:{subMenuSelectable:!1},filterProps:{},resizable:!1},a._typeMark="column",r);function p(){return(0,o.default)(this,p),(0,i.default)(this,c.apply(this,arguments))}f.displayName="Column",t.default=f,e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var a=l(n(3)),r=l(n(5)),o=l(n(6)),i=l(n(0)),s=l(n(2));function l(e){return e&&e.__esModule?e:{default:e}}var u,d=(u=i.default.Component,(0,o.default)(c,u),c.prototype.render=function(){var e=this.props,t=e.children,n=e.wrapperContent,a=e.prefix;return i.default.createElement("div",{className:a+"table-inner"},t,n)},c.propTypes={children:s.default.any,prefix:s.default.string,colGroup:s.default.any,wrapperContent:s.default.any},c);function c(){return(0,a.default)(this,c),(0,r.default)(this,u.apply(this,arguments))}d.displayName="FixedWrapper",t.default=d,e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0;var a,r,k=h(n(18)),S=h(n(4)),o=h(n(3)),s=h(n(5)),i=h(n(6)),l=n(0),E=h(l),u=h(n(2)),L=h(n(12)),d=h(n(116)),c=h(n(23)),x=n(11),f=h(n(42)),p=h(n(8));function h(e){return e&&e.__esModule?e:{default:e}}var m,g=x.func.noop,y=x.func.bindCtx,v=/blue|green|orange|red|turquoise|yellow/,_=(m=l.Component,(0,i.default)(T,m),T.prototype.componentWillUnmount=function(){this.__destroyed=!0},T.prototype.handleClose=function(e){var t=this,n=this.props,a=n.animation,r=n.onClose,o=x.support.animation&&a;!1===r(e,this.tagNode)||this.__destroyed||this.setState({visible:!1},function(){o||t.props.afterClose(t.tagNode)})},T.prototype.handleBodyClick=function(e){var t=this.props,n=t.closable,a=t.closeArea,r=t.onClick;if(n&&"tag"===a&&this.handleClose("tag"),"function"==typeof r)return r(e)},T.prototype.handleTailClick=function(e){e&&e.preventDefault(),e&&e.stopPropagation(),this.handleClose("tail")},T.prototype.handleAnimationInit=function(e){this.props.afterAppear(e)},T.prototype.handleAnimationEnd=function(e){this.props.afterClose(e)},T.prototype.renderAnimatedTag=function(e,t){return E.default.createElement(d.default,{animation:t,afterAppear:this.handleAnimationInit,afterLeave:this.handleAnimationEnd},e)},T.prototype.renderTailNode=function(){var e=this.props,t=e.prefix,n=e.closable,a=e.locale;return n?E.default.createElement("span",{className:t+"tag-close-btn",onClick:this.handleTailClick,role:"button","aria-label":a.delete},E.default.createElement(c.default,{type:"close"})):null},T.prototype.isPresetColor=function(){var e=this.props.color;return!!e&&v.test(e)},T.prototype.getTagStyle=function(){var e=this.props,t=e.color,n=void 0===t?"":t,a=e.style,r=this.isPresetColor(),o={backgroundColor:n,borderColor:n,color:"#fff"};return(0,S.default)({},n&&!r?o:null,a)},T.prototype.render=function(){var e,t=this,n=this.props,a=n.prefix,r=n.type,o=n.size,i=n.color,s=n._shape,l=n.closable,u=n.closeArea,d=n.className,c=n.children,f=n.animation,p=n.disabled,h=n.rtl,m=this.state.visible,g=this.isPresetColor(),y=x.obj.pickOthers(T.propTypes,this.props),v=(y.style,(0,k.default)(y,["style"])),_=l?"closable":s,b=(0,L.default)([a+"tag",a+"tag-"+_,a+"tag-"+o],((e={})[a+"tag-level-"+r]=!i,e[a+"tag-closable"]=l,e[a+"tag-body-pointer"]=l&&"tag"===u,e[a+"tag-"+i]=i&&g&&"primary"===r,e[a+"tag-"+i+"-inverse"]=i&&g&&"normal"===r,e),d),w=this.renderTailNode(),M=m?E.default.createElement("div",(0,S.default)({className:b,onClick:this.handleBodyClick,onKeyDown:this.onKeyDown,tabIndex:p?"":"0",role:"button","aria-disabled":p,disabled:p,dir:h?"rtl":void 0,ref:function(e){return t.tagNode=e},style:this.getTagStyle()},v),E.default.createElement("span",{className:a+"tag-body"},c),w):null;return f&&x.support.animation?this.renderAnimatedTag(M,a+"tag-zoom"):M},r=a=T,a.propTypes={prefix:u.default.string,type:u.default.oneOf(["normal","primary"]),size:u.default.oneOf(["small","medium","large"]),color:u.default.string,animation:u.default.bool,closeArea:u.default.oneOf(["tag","tail"]),closable:u.default.bool,onClose:u.default.func,afterClose:u.default.func,afterAppear:u.default.func,className:u.default.any,children:u.default.node,onClick:u.default.func,_shape:u.default.oneOf(["default","closable","checkable"]),disabled:u.default.bool,rtl:u.default.bool,locale:u.default.object},a.defaultProps={prefix:"next-",type:"normal",size:"medium",closeArea:"tail",animation:!1,onClose:g,afterClose:g,afterAppear:g,onClick:g,_shape:"default",disabled:!1,rtl:!1,locale:f.default.Tag},r);function T(e){(0,o.default)(this,T);var i=(0,s.default)(this,m.call(this,e));return i.onKeyDown=function(e){var t=i.props,n=t.closable,a=t.closeArea,r=t.onClick,o=t.disabled;e.keyCode!==x.KEYCODE.SPACE||o||(e.preventDefault(),e.stopPropagation(),n?i.handleClose(a):"function"==typeof r&&r(e))},i.state={visible:!0},y(i,["handleBodyClick","handleTailClick","handleAnimationInit","handleAnimationEnd","renderTailNode"]),i}_.displayName="Tag",t.default=p.default.config(_),e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0;var p=r(n(18)),h=r(n(48)),m=r(n(4));t.isSingle=function(e){return!e||"single"===e},t.isNull=g,t.escapeForReg=o,t.filter=function(e,t){var n=o(""+e),a=new RegExp("("+n+")","ig");return a.test(""+t.value)||a.test(""+t.label)},t.loopMap=i,t.parseDataSourceFromChildren=function l(e){var u=1=p,C=(0,A.default)(((t={})[i+"upload-inner"]=!0,t[i+"hidden"]=T,t)),D=this.props.children;if("card"===l&&(a=(0,A.default)(((n={})[i+"upload-card"]=!0,n[i+"disabled"]=f,n)),D=R.default.createElement("div",{className:a},R.default.createElement(F.default,{size:"large",type:"add",className:i+"upload-add-icon"}),R.default.createElement("div",{tabIndex:"0",role:"button",className:i+"upload-text"},D))),S){if("function"!=typeof E)return o?R.default.createElement(W.default,{isPreview:!0,listType:o,style:d,className:u,value:this.state.value}):null;var O,N=(0,A.default)(((O={})[i+"form-preview"]=!0,O[u]=!!u,O));return R.default.createElement("div",{style:d,className:N},E(this.state.value,this.props))}var Y=f?H.func.prevent:y,P=H.obj.pickAttrsWith(this.props,"data-");return R.default.createElement("div",(0,j.default)({className:x,style:d},P),R.default.createElement(z.default,(0,j.default)({},L,{beforeUpload:m,dragable:s,disabled:f||T,className:C,onSelect:this.onSelect,onDrop:this.onDrop,onProgress:this.onProgress,onSuccess:this.onSuccess,onError:this.onError,ref:this.saveUploaderRef}),D),o||b?R.default.createElement(W.default,{useDataURL:c,uploader:this,listType:o,value:this.state.value,closable:h,onRemove:Y,progressProps:M,onCancel:v,onPreview:_,extraRender:w,rtl:k}):null)},r=a=v,a.displayName="Upload",a.propTypes=(0,j.default)({},f.default.propTypes,W.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,isPreview:u.default.bool,renderPreview:u.default.func}),a.defaultProps=(0,j.default)({},f.default.defaultProps,{prefix:"next-",limit:1/0,autoUpload:!0,closable:!0,onSelect:g,onProgress:g,onChange:g,onSuccess:g,onRemove:g,onError:g,onDrop:g,beforeUpload:g,afterSelect:g}),o=function(){var f=this;this.onSelect=function(e){var t,n,a,r,o=f.props,i=o.autoUpload,s=o.afterSelect,l=o.onSelect,u=o.limit,d=f.state.value.length+e.length,c=u-f.state.value.length;c<=0||(n=t=e.map(function(e){var t=(0,p.fileToObject)(e);return t.state="selected",t}),a=[],u 16.8.0")},h.prototype.validate=function(e,t){this.validateCallback(e,t)},h.prototype.reset=function(e,t){var n=1","Select");var n=u(e,t);return e.onInputUpdate&&(n.onSearch=e.onInputUpdate,n.showSearch=!0),n}}),t.default=a.default.config(r.default,{transform:u,exportNames:["focusInput","handleSearchClear"]}),e.exports=t.default},function(e,t,n){"use strict";n(40),n(506)},function(e,t,n){"use strict";n.d(t,"a",function(){return k}),n.d(t,"b",function(){return T}),n.d(t,"c",function(){return y}),n.d(t,"d",function(){return Y}),n.d(t,"e",function(){return g}),n.d(t,"f",function(){return x}),n.d(t,"g",function(){return P});var a=n(54),r=n(0),u=n.n(r),l=(n(2),n(59)),o=n(168),d=n(55),c=n(34),i=n(169),p=n.n(i),s=(n(124),n(53)),f=n(108),h=n.n(f),m=function(e){var t=Object(o.a)();return t.displayName=e,t}("Router-History"),g=function(e){var t=Object(o.a)();return t.displayName=e,t}("Router"),y=function(n){function e(e){var t=n.call(this,e)||this;return t.state={location:e.history.location},t._isMounted=!1,t._pendingLocation=null,e.staticContext||(t.unlisten=e.history.listen(function(e){t._isMounted?t.setState({location:e}):t._pendingLocation=e})),t}Object(a.a)(e,n),e.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var t=e.prototype;return t.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},t.componentWillUnmount=function(){this.unlisten&&this.unlisten()},t.render=function(){return u.a.createElement(g.Provider,{value:{history:this.props.history,location:this.state.location,match:e.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},u.a.createElement(m.Provider,{children:this.props.children||null,value:this.props.history}))},e}(u.a.Component);u.a.Component;var v=function(e){function t(){return e.apply(this,arguments)||this}Object(a.a)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.props.onMount&&this.props.onMount.call(this,this)},n.componentDidUpdate=function(e){this.props.onUpdate&&this.props.onUpdate.call(this,this,e)},n.componentWillUnmount=function(){this.props.onUnmount&&this.props.onUnmount.call(this,this)},n.render=function(){return null},t}(u.a.Component);var _={},b=1e4,w=0;function M(e,t){return void 0===e&&(e="/"),void 0===t&&(t={}),"/"===e?e:function(e){if(_[e])return _[e];var t=p.a.compile(e);return wt?n.splice(t,n.length-t,a):n.push(a),u({action:"PUSH",location:a,index:t,entries:n}))})},replace:function(e,t){var n=P(e,t,d(),h.location);l.confirmTransitionTo(n,"REPLACE",r,function(e){e&&u({action:"REPLACE",location:h.entries[h.index]=n})})},go:p,goBack:function(){p(-1)},goForward:function(){p(1)},canGo:function(e){var t=h.index+e;return 0<=t&&tx',"Tag"),"readonly"!==n&&"interactive"!==n||r.log.warning("Warning: [ shape="+n+" ] is deprecated at [ Tag ]"),"secondary"===a&&r.log.warning("Warning: [ type=secondary ] is deprecated at [ Tag ]"),["count","marked","value","onChange"].forEach(function(e){e in t&&r.log.warning("Warning: [ "+e+" ] is deprecated at [ Tag ]")}),("selected"in t||"defaultSelected"in t)&&r.log.warning("Warning: [ selected|defaultSelected ] is deprecated at [ Tag ], use [ checked|defaultChecked ] at [ Tag.Selectable ] instead of it"),"closed"in t&&r.log.warning("Warning: [ closed ] is deprecated at [ Tag ], use [ onClose ] at [ Tag.Closeable ] instead of it"),"onSelect"in t&&e("onSelect","","Tag"),"afterClose"in t&&r.log.warning("Warning: [ afterClose ] is deprecated at [ Tag ], use [ afterClose ] at [ Tag.Closeable ] instead of it"),t}});d.Group=a.default.config(i.default),d.Selectable=a.default.config(s.default),d.Closable=a.default.config(l.default),d.Closeable=d.Closable,t.default=d,e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0;var a=o(n(685)),r=o(n(388));function o(e){return e&&e.__esModule?e:{default:e}}a.default.Panel=r.default,t.default=a.default,e.exports=t.default},function(e,t,n){var a=n(85);e.exports=function(e){if(!a(e))throw TypeError(e+" is not an object!");return e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){"use strict";n(40),n(66),n(503)},function(e,t,n){var i=n(334);function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}e.exports=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n,a={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e){Object.prototype.hasOwnProperty.call(e,o)&&((n=r?Object.getOwnPropertyDescriptor(e,o):null)&&(n.get||n.set)?Object.defineProperty(a,o,n):a[o]=e[o])}return a.default=e,t&&t.set(e,a),a}},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var a,r,L=f(n(4)),o=f(n(3)),i=f(n(5)),s=f(n(6)),l=n(0),x=f(l),u=n(24),d=f(n(2)),T=f(n(12)),c=n(11);function f(e){return e&&e.__esModule?e:{default:e}}var p,h=c.func.bindCtx,C=c.obj.pickOthers,m=(p=l.Component,(0,s.default)(D,p),D.prototype.componentDidMount=function(){this.itemNode=(0,u.findDOMNode)(this);var e,t,n,a,r=this.props,o=r.parentMode,i=r.root,s=r.menu;s?this.menuNode=(0,u.findDOMNode)(s):"popup"===o?this.menuNode=this.itemNode.parentNode:(this.menuNode=(0,u.findDOMNode)(i),t=(e=i.props).prefix,n=e.header,a=e.footer,(n||a)&&(this.menuNode=this.menuNode.querySelector("."+t+"menu-content"))),this.setFocus()},D.prototype.componentDidUpdate=function(){this.setFocus()},D.prototype.focusable=function(){var e=this.props,t=e.root,n=e.type,a=e.disabled,r=t.props.focusable;return r&&("submenu"===n||!a)},D.prototype.getFocused=function(){var e=this.props,t=e._key;return e.root.state.focusedKey===t},D.prototype.setFocus=function(){var e;this.getFocused()&&(this.focusable()&&this.itemNode.focus({preventScroll:!0}),this.menuNode&&this.menuNode.scrollHeight>this.menuNode.clientHeight&&(this.menuNode.clientHeight+this.menuNode.scrollTop<(e=this.itemNode.offsetTop+this.itemNode.offsetHeight)?this.menuNode.scrollTop=e-this.menuNode.clientHeight:this.itemNode.offsetTop"===(d=e.charAt(o+1))){r+="(",o++,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 t)a.call(t,n)&&e.push(n);return e}().length},r.subStrCount=function(e,t,n,a){var r,o,i,s,l,u=0;for(e=""+e,t=""+t,null!=n&&(e=e.slice(n)),null!=a&&(e=e.slice(0,a)),i=e.length,l=t.length,r=o=0,s=i;0<=s?o>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,r,o,i,s,l,u,d;if(null==e||!e.length)return null;if(!(o=this.PATTERN_DATE.exec(e)))return null;if(d=parseInt(o.year,10),s=parseInt(o.month,10)-1,n=parseInt(o.day,10),null==o.hour)return t=new Date(Date.UTC(d,s,n));if(r=parseInt(o.hour,10),i=parseInt(o.minute,10),l=parseInt(o.second,10),null!=o.fraction){for(a=o.fraction.slice(0,3);a.length<3;)a+="0";a=parseInt(a,10)}else a=0;return null!=o.tz&&(u=6e4*(60*parseInt(o.tz_hour,10)+(null!=o.tz_minute?parseInt(o.tz_minute,10):0)),"-"===o.tz_sign&&(u*=-1)),t=new Date(Date.UTC(d,s,n,r,i,l,a)),u&&t.setTime(t.getTime()-u),t},r.strRepeat=function(e,t){for(var n="",a=0;ae.length)&&(t=e.length);for(var n=0,a=new Array(t);ndocument.F=Object<\/script>"),e.close(),d=e.F;n--;)delete d[u][s[n]];return d()};e.exports=Object.create||function(e,t){var n;return null!==e?(r[u]=o(e),n=new r,r[u]=null,n[l]=e):n=d(),void 0===t?n:i(n,t)}},function(e,t,n){var a=n(76).f,r=n(77),o=n(87)("toStringTag");e.exports=function(e,t,n){e&&!r(e=n?e:e.prototype,o)&&a(e,o,{configurable:!0,value:t})}},function(e,t,n){t.f=n(87)},function(e,t,n){var a=n(71),r=n(72),o=n(113),i=n(146),s=n(76).f;e.exports=function(e){var t=r.Symbol||(r.Symbol=!o&&a.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:i.f(e)})}},function(e,t,n){"use strict";n(75),n(505)},function(e,t,n){},function(e,t,n){e.exports=n(516)},function(e,t){function l(e,t,n,a,r,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}e.exports=function(s){return function(){var e=this,i=arguments;return new Promise(function(t,n){var a=s.apply(e,i);function r(e){l(a,t,n,r,o,"next",e)}function o(e){l(a,t,n,r,o,"throw",e)}r(void 0)})}}},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(s,e,l){"use strict";(function(e){var n=l(56),a=l(551),t={"Content-Type":"application/x-www-form-urlencoded"};function r(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var o,i={adapter:("undefined"==typeof XMLHttpRequest&&void 0===e||(o=l(347)),o),transformRequest:[function(e,t){return a(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(r(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)?(r(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return 200<=e&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],function(e){i.headers[e]={}}),n.forEach(["post","put","patch"],function(e){i.headers[e]=n.merge(t)}),s.exports=i}).call(this,l(338))},function(e,t,n){"use strict";function s(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},a=0;a>6]+u[128|63&i]:i<55296||57344<=i?r+=u[224|i>>12]+u[128|i>>6&63]+u[128|63&i]:(o+=1,i=65536+((1023&i)<<10|1023&a.charCodeAt(o)),r+=u[240|i>>18]+u[128|i>>12&63]+u[128|i>>6&63]+u[128|63&i])}return r},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(d(e)){for(var n=[],a=0;aa.length&&a.every(function(e,t){return e===n[t]})},t.isAvailablePos=function(e,t,n){var a=n[t],r=a.type,o=a.disabled;return i(e,t)&&("item"===r&&!o||"submenu"===r)});t.getFirstAvaliablelChildKey=function(t,n){var e=Object.keys(n).find(function(e){return a(t+"-0",e,n)});return e?n[e].key:null},t.getChildSelected=function(e){var t=e.selectMode,n=e.selectedKeys,a=e._k2n,r=e._key;if(!a)return!1;var o=(a[r]&&a[r].pos)+"-";return!!t&&n.some(function(e){return a[e]&&0===a[e].pos.indexOf(o)})}},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var a,r,o=d(n(3)),i=d(n(5)),s=d(n(6)),l=d(n(0)),u=d(n(2));function d(e){return e&&e.__esModule?e:{default:e}}var c,f=(c=l.default.Component,(0,s.default)(p,c),p.prototype.render=function(){return null},r=a=p,a.propTypes={dataIndex:u.default.string,cell:u.default.oneOfType([u.default.element,u.default.node,u.default.func]),title:u.default.oneOfType([u.default.element,u.default.node,u.default.func]),htmlTitle:u.default.string,sortable:u.default.bool,width:u.default.oneOfType([u.default.number,u.default.string]),align:u.default.oneOf(["left","center","right"]),alignHeader:u.default.oneOf(["left","center","right"]),filters:u.default.arrayOf(u.default.shape({label:u.default.string,value:u.default.oneOfType([u.default.node,u.default.string])})),filterMode:u.default.oneOf(["single","multiple"]),filterMenuProps:u.default.object,filterProps:u.default.object,lock:u.default.oneOfType([u.default.bool,u.default.string]),resizable:u.default.bool,colSpan:u.default.number},a.contextTypes={parent:u.default.any},a.defaultProps={cell:function(e){return e},filterMode:"multiple",filterMenuProps:{subMenuSelectable:!1},filterProps:{},resizable:!1},a._typeMark="column",r);function p(){return(0,o.default)(this,p),(0,i.default)(this,c.apply(this,arguments))}f.displayName="Column",t.default=f,e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var a=l(n(3)),r=l(n(5)),o=l(n(6)),i=l(n(0)),s=l(n(2));function l(e){return e&&e.__esModule?e:{default:e}}var u,d=(u=i.default.Component,(0,o.default)(c,u),c.prototype.render=function(){var e=this.props,t=e.children,n=e.wrapperContent,a=e.prefix;return i.default.createElement("div",{className:a+"table-inner"},t,n)},c.propTypes={children:s.default.any,prefix:s.default.string,colGroup:s.default.any,wrapperContent:s.default.any},c);function c(){return(0,a.default)(this,c),(0,r.default)(this,u.apply(this,arguments))}d.displayName="FixedWrapper",t.default=d,e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0;var a,r,k=h(n(18)),S=h(n(4)),o=h(n(3)),s=h(n(5)),i=h(n(6)),l=n(0),E=h(l),u=h(n(2)),L=h(n(12)),d=h(n(116)),c=h(n(23)),x=n(11),f=h(n(42)),p=h(n(8));function h(e){return e&&e.__esModule?e:{default:e}}var m,g=x.func.noop,y=x.func.bindCtx,v=/blue|green|orange|red|turquoise|yellow/,_=(m=l.Component,(0,i.default)(T,m),T.prototype.componentWillUnmount=function(){this.__destroyed=!0},T.prototype.handleClose=function(e){var t=this,n=this.props,a=n.animation,r=n.onClose,o=x.support.animation&&a;!1===r(e,this.tagNode)||this.__destroyed||this.setState({visible:!1},function(){o||t.props.afterClose(t.tagNode)})},T.prototype.handleBodyClick=function(e){var t=this.props,n=t.closable,a=t.closeArea,r=t.onClick;if(n&&"tag"===a&&this.handleClose("tag"),"function"==typeof r)return r(e)},T.prototype.handleTailClick=function(e){e&&e.preventDefault(),e&&e.stopPropagation(),this.handleClose("tail")},T.prototype.handleAnimationInit=function(e){this.props.afterAppear(e)},T.prototype.handleAnimationEnd=function(e){this.props.afterClose(e)},T.prototype.renderAnimatedTag=function(e,t){return E.default.createElement(d.default,{animation:t,afterAppear:this.handleAnimationInit,afterLeave:this.handleAnimationEnd},e)},T.prototype.renderTailNode=function(){var e=this.props,t=e.prefix,n=e.closable,a=e.locale;return n?E.default.createElement("span",{className:t+"tag-close-btn",onClick:this.handleTailClick,role:"button","aria-label":a.delete},E.default.createElement(c.default,{type:"close"})):null},T.prototype.isPresetColor=function(){var e=this.props.color;return!!e&&v.test(e)},T.prototype.getTagStyle=function(){var e=this.props,t=e.color,n=void 0===t?"":t,a=e.style,r=this.isPresetColor(),o={backgroundColor:n,borderColor:n,color:"#fff"};return(0,S.default)({},n&&!r?o:null,a)},T.prototype.render=function(){var e,t=this,n=this.props,a=n.prefix,r=n.type,o=n.size,i=n.color,s=n._shape,l=n.closable,u=n.closeArea,d=n.className,c=n.children,f=n.animation,p=n.disabled,h=n.rtl,m=this.state.visible,g=this.isPresetColor(),y=x.obj.pickOthers(T.propTypes,this.props),v=(y.style,(0,k.default)(y,["style"])),_=l?"closable":s,b=(0,L.default)([a+"tag",a+"tag-"+_,a+"tag-"+o],((e={})[a+"tag-level-"+r]=!i,e[a+"tag-closable"]=l,e[a+"tag-body-pointer"]=l&&"tag"===u,e[a+"tag-"+i]=i&&g&&"primary"===r,e[a+"tag-"+i+"-inverse"]=i&&g&&"normal"===r,e),d),w=this.renderTailNode(),M=m?E.default.createElement("div",(0,S.default)({className:b,onClick:this.handleBodyClick,onKeyDown:this.onKeyDown,tabIndex:p?"":"0",role:"button","aria-disabled":p,disabled:p,dir:h?"rtl":void 0,ref:function(e){return t.tagNode=e},style:this.getTagStyle()},v),E.default.createElement("span",{className:a+"tag-body"},c),w):null;return f&&x.support.animation?this.renderAnimatedTag(M,a+"tag-zoom"):M},r=a=T,a.propTypes={prefix:u.default.string,type:u.default.oneOf(["normal","primary"]),size:u.default.oneOf(["small","medium","large"]),color:u.default.string,animation:u.default.bool,closeArea:u.default.oneOf(["tag","tail"]),closable:u.default.bool,onClose:u.default.func,afterClose:u.default.func,afterAppear:u.default.func,className:u.default.any,children:u.default.node,onClick:u.default.func,_shape:u.default.oneOf(["default","closable","checkable"]),disabled:u.default.bool,rtl:u.default.bool,locale:u.default.object},a.defaultProps={prefix:"next-",type:"normal",size:"medium",closeArea:"tail",animation:!1,onClose:g,afterClose:g,afterAppear:g,onClick:g,_shape:"default",disabled:!1,rtl:!1,locale:f.default.Tag},r);function T(e){(0,o.default)(this,T);var i=(0,s.default)(this,m.call(this,e));return i.onKeyDown=function(e){var t=i.props,n=t.closable,a=t.closeArea,r=t.onClick,o=t.disabled;e.keyCode!==x.KEYCODE.SPACE||o||(e.preventDefault(),e.stopPropagation(),n?i.handleClose(a):"function"==typeof r&&r(e))},i.state={visible:!0},y(i,["handleBodyClick","handleTailClick","handleAnimationInit","handleAnimationEnd","renderTailNode"]),i}_.displayName="Tag",t.default=p.default.config(_),e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0;var p=r(n(18)),h=r(n(48)),m=r(n(4));t.isSingle=function(e){return!e||"single"===e},t.isNull=g,t.escapeForReg=o,t.filter=function(e,t){var n=o(""+e),a=new RegExp("("+n+")","ig");return a.test(""+t.value)||a.test(""+t.label)},t.loopMap=i,t.parseDataSourceFromChildren=function l(e){var u=1=p,C=(0,A.default)(((t={})[i+"upload-inner"]=!0,t[i+"hidden"]=T,t)),D=this.props.children;if("card"===l&&(a=(0,A.default)(((n={})[i+"upload-card"]=!0,n[i+"disabled"]=f,n)),D=R.default.createElement("div",{className:a},R.default.createElement(F.default,{size:"large",type:"add",className:i+"upload-add-icon"}),R.default.createElement("div",{tabIndex:"0",role:"button",className:i+"upload-text"},D))),S){if("function"!=typeof E)return o?R.default.createElement(W.default,{isPreview:!0,listType:o,style:d,className:u,value:this.state.value}):null;var O,N=(0,A.default)(((O={})[i+"form-preview"]=!0,O[u]=!!u,O));return R.default.createElement("div",{style:d,className:N},E(this.state.value,this.props))}var Y=f?H.func.prevent:y,P=H.obj.pickAttrsWith(this.props,"data-");return R.default.createElement("div",(0,j.default)({className:x,style:d},P),R.default.createElement(z.default,(0,j.default)({},L,{beforeUpload:m,dragable:s,disabled:f||T,className:C,onSelect:this.onSelect,onDrop:this.onDrop,onProgress:this.onProgress,onSuccess:this.onSuccess,onError:this.onError,ref:this.saveUploaderRef}),D),o||b?R.default.createElement(W.default,{useDataURL:c,uploader:this,listType:o,value:this.state.value,closable:h,onRemove:Y,progressProps:M,onCancel:v,onPreview:_,extraRender:w,rtl:k}):null)},r=a=v,a.displayName="Upload",a.propTypes=(0,j.default)({},f.default.propTypes,W.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,isPreview:u.default.bool,renderPreview:u.default.func}),a.defaultProps=(0,j.default)({},f.default.defaultProps,{prefix:"next-",limit:1/0,autoUpload:!0,closable:!0,onSelect:g,onProgress:g,onChange:g,onSuccess:g,onRemove:g,onError:g,onDrop:g,beforeUpload:g,afterSelect:g}),o=function(){var f=this;this.onSelect=function(e){var t,n,a,r,o=f.props,i=o.autoUpload,s=o.afterSelect,l=o.onSelect,u=o.limit,d=f.state.value.length+e.length,c=u-f.state.value.length;c<=0||(n=t=e.map(function(e){var t=(0,p.fileToObject)(e);return t.state="selected",t}),a=[],u=11?e:e+12}else if(t==="下午"||t==="晚上"){return e+12}},meridiem:function(e,t,n){var a=e*100+t;if(a<600){return"凌晨"}else if(a<900){return"早上"}else if(a<1130){return"上午"}else if(a<1230){return"中午"}else if(a<1800){return"下午"}else{return"晚上"}},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n(7))},function(e,t,n){!function(e){"use strict"; //! moment.js locale configuration -var t;e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){if(e===12){e=0}if(t==="凌晨"||t==="早上"||t==="上午"){return e}else if(t==="中午"){return e>=11?e:e+12}else if(t==="下午"||t==="晚上"){return e+12}},meridiem:function(e,t,n){var a=e*100+t;if(a<600){return"凌晨"}else if(a<900){return"早上"}else if(a<1130){return"上午"}else if(a<1230){return"中午"}else if(a<1800){return"下午"}else{return"晚上"}},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n(7))},function(e,t,n){"use strict";t.__esModule=!0;var a,r,w=p(n(4)),o=p(n(3)),i=p(n(5)),s=p(n(6)),l=n(0),M=p(l),u=p(n(2)),d=n(29),k=p(n(12)),c=p(n(42)),S=p(n(23)),E=p(n(116)),f=p(n(8)),L=n(11);function p(e){return e&&e.__esModule?e:{default:e}}function h(){}var m,g=(m=l.Component,(0,s.default)(x,m),x.getDerivedStateFromProps=function(e){return"visible"in e?{visible:e.visible}:{}},x.prototype.render=function(){var e,t=this.props,n=t.prefix,a=(t.pure,t.className),r=t.style,o=t.type,i=t.shape,s=t.size,l=t.title,u=t.children,d=(t.defaultVisible,t.visible,t.iconType),c=t.closeable,f=(t.onClose,t.afterClose),p=t.animation,h=t.rtl,m=t.locale,g=(0,w.default)({},L.obj.pickOthers(Object.keys(x.propTypes),this.props)),y=this.state.visible,v=n+"message",_=(0,k.default)(((e={})[v]=!0,e[n+"message-"+o]=o,e[""+n+i]=i,e[""+n+s]=s,e[n+"title-content"]=!!l,e[n+"only-content"]=!l&&!!u,e[a]=a,e)),b=y?M.default.createElement("div",(0,w.default)({role:"alert",style:r},g,{className:_,dir:h?"rtl":void 0}),c?M.default.createElement("a",{role:"button","aria-label":m.closeAriaLabel,className:v+"-close",onClick:this.onClose},M.default.createElement(S.default,{type:"close"})):null,M.default.createElement(S.default,{className:v+"-symbol "+(!d&&v+"-symbol-icon"),type:d}),l?M.default.createElement("div",{className:v+"-title"},l):null,u?M.default.createElement("div",{className:v+"-content"},u):null):null;return p?M.default.createElement(E.default.Expand,{animationAppear:!1,afterLeave:f},b):b},r=a=x,a.propTypes={prefix:u.default.string,pure:u.default.bool,className:u.default.string,style:u.default.object,type:u.default.oneOf(["success","warning","error","notice","help","loading"]),shape:u.default.oneOf(["inline","addon","toast"]),size:u.default.oneOf(["medium","large"]),title:u.default.node,children:u.default.node,defaultVisible:u.default.bool,visible:u.default.bool,iconType:u.default.string,closeable:u.default.bool,onClose:u.default.func,afterClose:u.default.func,animation:u.default.bool,locale:u.default.object,rtl:u.default.bool},a.defaultProps={prefix:"next-",pure:!1,type:"success",shape:"inline",size:"medium",defaultVisible:!0,closeable:!1,onClose:h,afterClose:h,animation:!0,locale:c.default.Message},r);function x(){var e,t;(0,o.default)(this,x);for(var n=arguments.length,a=Array(n),r=0;re.clientHeight&&0this.popupNode.offsetWidth&&m(this.popupNode,"width",e.offsetWidth+"px"),"outside"!==d||"hoz"===u&&1===a||(m(this.popupNode,"height",p.offsetHeight+"px"),m(this.popupNode,"overflow-y","scroll"));var h=this.popupProps;h.onOpen&&h.onOpen()},j.prototype.handlePopupClose=function(){var e=this.props.root.popupNodes,t=e.indexOf(this.popupNode);-1 "+this.message+" (line "+this.parsedLine+": '"+this.snippet+"')":" "+this.message},e.exports=n},function(e,t){var r={}.hasOwnProperty;function n(e,t,n){this.message=e,this.parsedLine=t,this.snippet=n}(function(e,t){for(var n in t)r.call(t,n)&&(e[n]=t[n]);function a(){this.constructor=e}a.prototype=t.prototype,e.prototype=new a,e.__super__=t.prototype})(n,Error),n.prototype.toString=function(){return null!=this.parsedLine&&null!=this.snippet?" "+this.message+" (line "+this.parsedLine+": '"+this.snippet+"')":" "+this.message},e.exports=n},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var a,r,S=m(n(4)),o=m(n(3)),i=m(n(5)),s=m(n(6)),l=n(0),E=m(l),u=n(24),d=m(n(2)),L=m(n(12)),c=n(11),v=m(n(50)),f=m(n(63)),x=m(n(10)),p=m(n(42)),h=m(n(631)),_=m(n(382)),b=n(160);function m(e){return e&&e.__esModule?e:{default:e}}var T=f.default.Popup,g=v.default.Item,y=v.default.Group,w=c.func.noop,M=c.func.bindCtx,C=c.func.makeChain;function k(e){e.preventDefault()}var D,O=(D=E.default.Component,(0,s.default)(N,D),N.prototype.componentDidMount=function(){var e=this;setTimeout(function(){return e.syncWidth()},0),c.events.on(window,"resize",this.handleResize)},N.prototype.componentDidUpdate=function(e,t){e.label===this.props.label&&t.value===this.state.value||this.syncWidth()},N.prototype.componentWillUnmount=function(){c.events.off(window,"resize",this.handleResize),clearTimeout(this.resizeTimeout)},N.prototype.syncWidth=function(){var e,t=this,n=this.props,a=n.popupStyle,r=n.popupProps;a&&"width"in a||r&&r.style&&"width"in r.style||(e=c.dom.getStyle(this.selectDOM,"width"))&&this.width!==e&&(this.width=e,this.popupRef&&this.shouldAutoWidth()&&setTimeout(function(){t.popupRef&&t.popupRef.getInstance().overlay&&c.dom.setStyle(t.popupRef.getInstance().overlay.getInstance().getContentNode(),"width",t.width)},0))},N.prototype.handleResize=function(){var e=this;clearTimeout(this.resizeTimeout),this.state.visible&&(this.resizeTimeout=setTimeout(function(){e.syncWidth()},200))},N.prototype.setDataSource=function(e){var t=e.dataSource,n=e.children;return l.Children.count(n)?this.dataStore.updateByDS(n,!0):Array.isArray(t)?this.dataStore.updateByDS(t,!1):[]},N.prototype.setVisible=function(e,t){this.props.disabled||this.state.visible===e||("visible"in this.props||this.setState({visible:e}),this.props.onVisibleChange(e,t))},N.prototype.setFirstHightLightKeyForMenu=function(){var e;this.props.autoHighlightFirstItem&&this.dataStore.getMenuDS().length&&this.dataStore.getEnableDS().length&&(e=""+this.dataStore.getEnableDS()[0].value,this.setState({highlightKey:e}),this.props.onToggleHighlightItem(e,"autoFirstItem"))},N.prototype.handleChange=function(e){var t;"value"in this.props||this.setState({value:e});for(var n=arguments.length,a=Array(1e.slidesToShow&&(a=e.slideWidth*e.slidesToShow*-1,i=e.slideHeight*e.slidesToShow*-1),e.slideCount%e.slidesToScroll!=0&&(t=e.slideIndex+e.slidesToScroll>e.slideCount&&e.slideCount>e.slidesToShow,e.rtl&&(t=(e.slideIndex>=e.slideCount?e.slideCount-e.slideIndex:e.slideIndex)+e.slidesToScroll>e.slideCount&&e.slideCount>e.slidesToShow),t&&(i=e.slideIndex>e.slideCount?(a=(e.slidesToShow-(e.slideIndex-e.slideCount))*e.slideWidth*-1,(e.slidesToShow-(e.slideIndex-e.slideCount))*e.slideHeight*-1):(a=e.slideCount%e.slidesToScroll*e.slideWidth*-1,e.slideCount%e.slidesToScroll*e.slideHeight*-1)))):e.slideCount%e.slidesToScroll!=0&&e.slideIndex+e.slidesToScroll>e.slideCount&&e.slideCount>e.slidesToShow&&(a=(e.slidesToShow-e.slideCount%e.slidesToScroll)*e.slideWidth),e.centerMode&&(e.infinite?a+=e.slideWidth*Math.floor(e.slidesToShow/2):a=e.slideWidth*Math.floor(e.slidesToShow/2)),r=e.vertical?e.slideIndex*e.slideHeight*-1+i:e.slideIndex*e.slideWidth*-1+a,!0===e.variableWidth&&(n=void 0,r=(o=e.slideCount<=e.slidesToShow||!1===e.infinite?s.default.findDOMNode(e.trackRef).childNodes[e.slideIndex]:(n=e.slideIndex+e.slidesToShow,s.default.findDOMNode(e.trackRef).childNodes[n]))?-1*o.offsetLeft:0,!0===e.centerMode&&(o=!1===e.infinite?s.default.findDOMNode(e.trackRef).children[e.slideIndex]:s.default.findDOMNode(e.trackRef).children[e.slideIndex+e.slidesToShow+1])&&(r=-1*o.offsetLeft+(e.listWidth-o.offsetWidth)/2)),r)}},function(e,t,n){"use strict";t.__esModule=!0;var a,r,y=c(n(4)),v=c(n(18)),o=c(n(3)),i=c(n(5)),s=c(n(6)),_=c(n(0)),l=c(n(2)),b=c(n(12)),u=c(n(8)),w=c(n(23)),d=n(11);function c(e){return e&&e.__esModule?e:{default:e}}var f,p=(f=_.default.Component,(0,s.default)(h,f),h.prototype.render=function(){var e,t,n=this.props,a=n.title,r=n.children,o=n.className,i=n.isExpanded,s=n.disabled,l=n.style,u=n.prefix,d=n.onClick,c=n.id,f=(0,v.default)(n,["title","children","className","isExpanded","disabled","style","prefix","onClick","id"]),p=(0,b.default)(((e={})[u+"collapse-panel"]=!0,e[u+"collapse-panel-hidden"]=!i,e[u+"collapse-panel-expanded"]=i,e[u+"collapse-panel-disabled"]=s,e[o]=o,e)),h=(0,b.default)(((t={})[u+"collapse-panel-icon"]=!0,t[u+"collapse-panel-icon-expanded"]=i,t)),m=c?c+"-heading":void 0,g=c?c+"-region":void 0;return _.default.createElement("div",(0,y.default)({className:p,style:l,id:c},f),_.default.createElement("div",{id:m,className:u+"collapse-panel-title",onClick:d,onKeyDown:this.onKeyDown,tabIndex:"0","aria-disabled":s,"aria-expanded":i,"aria-controls":g,role:"button"},_.default.createElement(w.default,{type:"arrow-right",className:h,"aria-hidden":"true"}),a),_.default.createElement("div",{className:u+"collapse-panel-content",role:"region",id:g},r))},r=a=h,a.propTypes={prefix:l.default.string,style:l.default.object,children:l.default.any,isExpanded:l.default.bool,disabled:l.default.bool,title:l.default.node,className:l.default.string,onClick:l.default.func,id:l.default.string},a.defaultProps={prefix:"next-",isExpanded:!1,onClick:d.func.noop},a.isNextPanel=!0,r);function h(){var e,n;(0,o.default)(this,h);for(var t=arguments.length,a=Array(t),r=0;r\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\n\t\tboolean isPublishOk = configService.publishConfig(dataId, group, "content");\n\t\tSystem.out.println(isPublishOk);\n\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(){return"TODO"}},{key:"getCppCode",value:function(){return"TODO"}},{key:"getShellCode",value:function(){return"TODO"}},{key:"getPythonCode",value:function(){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=Z.a.createElement("div",null);return Z.a.createElement("div",null,Z.a.createElement(F.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(ie.a,{tip:t.loading,style:{width:"100%"},visible:this.state.loading},Z.a.createElement(le.a,{shape:"text",style:{height:40,paddingBottom:10}},Z.a.createElement(ue,{title:"Java",key:1,onClick:this.changeTab.bind(this,"commoneditor1",this.defaultCode)}),Z.a.createElement(ue,{title:"Spring Boot",key:2,onClick:this.changeTab.bind(this,"commoneditor2",this.sprigboot_code)}),Z.a.createElement(ue,{title:"Spring Cloud",key:21,onClick:this.changeTab.bind(this,"commoneditor21",this.sprigcloud_code)}),Z.a.createElement(ue,{title:"Node.js",key:3,onClick:this.changeTab.bind(this,"commoneditor3",this.nodejsCode)}),Z.a.createElement(ue,{title:"C++",key:4,onClick:this.changeTab.bind(this,"commoneditor4",this.cppCode)}),Z.a.createElement(ue,{title:"Shell",key:5,onClick:this.changeTab.bind(this,"commoneditor5",this.shellCode)}),Z.a.createElement(ue,{title:"Python",key:6,onClick:this.changeTab.bind(this,"commoneditor6",this.pythonCode)})),Z.a.createElement("div",{ref:"codepreview"})))))}}]),a}(Z.a.Component),r.displayName="ShowCodeing",a=o))||a,ce=(n(67),n(38)),fe=n.n(ce),pe=(n(674),fe.a.Row),he=fe.a.Col,me=(0,J.a.config)((l=s=function(e){Object(K.a)(a,e);var n=Object(G.a)(a);function a(e){var t;return Object(V.a)(this,a),(t=n.call(this,e)).state={visible:!1,title:"",content:"",isok:!0,dataId:"",group:""},t}return Object(B.a)(a,[{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=Z.a.createElement("div",{style:{textAlign:"right"}},Z.a.createElement(M.a,{type:"primary",onClick:this.closeDialog.bind(this)},t.determine));return Z.a.createElement("div",null,Z.a.createElement(F.a,{visible:this.state.visible,footer:n,style:{width:555},onCancel:this.closeDialog.bind(this),onClose:this.closeDialog.bind(this),title:t.deletetitle},Z.a.createElement("div",null,Z.a.createElement(pe,null,Z.a.createElement(he,{span:"4",style:{paddingTop:16}},Z.a.createElement(I.a,{type:"".concat(this.state.isok?"success":"delete","-filling"),style:{color:this.state.isok?"green":"red"},size:"xl"})),Z.a.createElement(he,{span:"20"},Z.a.createElement("div",null,Z.a.createElement("h3",null,this.state.isok?t.deletedSuccessfully:t.deleteFailed),Z.a.createElement("p",null,Z.a.createElement("span",{style:{color:"#999",marginRight:5}},"Data ID:"),Z.a.createElement("span",{style:{color:"#c7254e"}},this.state.dataId)),Z.a.createElement("p",null,Z.a.createElement("span",{style:{color:"#999",marginRight:5}},"Group:"),Z.a.createElement("span",{style:{color:"#c7254e"}},this.state.group)),this.state.isok?"":Z.a.createElement("p",{style:{color:"red"}},this.state.message)))))))}}]),a}(Z.a.Component),s.displayName="DeleteDialog",i=l))||i,ge=(n(675),n(401)),ye=n.n(ge),ve=(0,J.a.config)((c=d=function(e){Object(K.a)(n,e);var t=Object(G.a)(n);function n(){return Object(V.a)(this,n),t.apply(this,arguments)}return Object(B.a)(n,[{key:"render",value:function(){var e=this.props,t=e.data,n=void 0===t?{}:t,a=e.height,r=e.locale,o=void 0===r?{}:r;return Z.a.createElement("div",null,"notice"===n.modeType?Z.a.createElement("div",{"data-spm-click":"gostr=/aliyun;locaid=notice"},Z.a.createElement(ye.a,{style:{marginBottom:1u?P.a.createElement(q.a,{className:"pagination",total:l.count,pageSize:u,onChange:function(e){return a.onChangePage(e)}}):null,P.a.createElement(Q,{ref:this.editInstanceDialog,serviceName:o,clusterName:n,groupName:i,openLoading:function(){return a.openLoading()},closeLoading:function(){return a.closeLoading()},getInstanceList:function(){return a.getInstanceList()}})):null}}]),a}(P.a.Component),d.displayName="InstanceTable",u=c))||u,Z=n(47),ee=(n(698),N.a.Item),te={labelCol:{fixedSpan:10},wrapperCol:{span:14}},ne=(0,D.a.config)((h=p=function(e){Object(x.a)(a,e);var n=Object(T.a)(a);function a(e){var t;return Object(E.a)(this,a),(t=n.call(this,e)).editServiceDialog=P.a.createRef(),t.editClusterDialog=P.a.createRef(),t.state={serviceName:Object(Z.b)(e.location.search,"name"),groupName:Object(Z.b)(e.location.search,"groupName"),loading:!1,currentPage:1,clusters:[],instances:{},service:{},pageSize:10,pageNum:{}},t}return Object(L.a)(a,[{key:"componentDidMount",value:function(){this.state.serviceName?this.getServiceDetail():this.props.history.goBack()}},{key:"getServiceDetail",value:function(){var o=this,e=this.state,t=e.serviceName,n=e.groupName;Object(j.c)({url:"v1/ns/catalog/service?serviceName=".concat(t,"&groupName=").concat(n),beforeSend:function(){return o.openLoading()},success:function(e){var t=e.clusters,n=void 0===t?[]:t,a=e.service,r=void 0===a?{}:a;return o.setState({service:r,clusters:n})},error:function(e){return k.a.error(e.responseText||"error")},complete:function(){return o.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,r=a.serviceName,o=a.groupName,i=a.loading,s=a.service,l=void 0===s?{}:s,u=a.clusters,d=l.metadata,c=void 0===d?{}:d,f=l.selector,p=void 0===f?{}:f,h="";return Object.keys(c).length&&(h=JSON.stringify(c,null,"\t")),P.a.createElement("div",{className:"main-container service-detail"},P.a.createElement(g.a,{shape:"flower",tip:"Loading...",className:"loading",visible:i,color:"#333"},P.a.createElement("h1",{style:{position:"relative",width:"100%"}},n.serviceDetails,P.a.createElement(w.a,{type:"primary",className:"header-btn",onClick:function(){return t.props.history.goBack()}},n.back),P.a.createElement(w.a,{type:"normal",className:"header-btn",onClick:function(){return t.openEditServiceDialog()}},n.editService)),P.a.createElement(N.a,te,P.a.createElement(ee,{label:"".concat(n.serviceName,":")},P.a.createElement(S.a,{value:l.name,readOnly:!0})),P.a.createElement(ee,{label:"".concat(n.groupName,":")},P.a.createElement(S.a,{value:l.groupName,readOnly:!0})),P.a.createElement(ee,{label:"".concat(n.protectThreshold,":")},P.a.createElement(S.a,{value:l.protectThreshold,readOnly:!0})),P.a.createElement(ee,{label:"".concat(n.metadata,":")},P.a.createElement(U.a,{language:"json",width:"100%",height:200,value:h,options:B.c})),P.a.createElement(ee,{label:"".concat(n.type,":")},P.a.createElement(S.a,{value:p.type,readOnly:!0})),"label"===l.type&&P.a.createElement(ee,{label:"".concat(n.selector,":")},P.a.createElement(S.a,{value:p.selector,readOnly:!0}))),u.map(function(e){return P.a.createElement(v.a,{key:e.name,className:"cluster-card",title:"".concat(n.cluster,":"),subTitle:e.name,contentHeight:"auto",extra:P.a.createElement(w.a,{type:"normal",onClick:function(){return t.openClusterDialog(e)}},n.editCluster)},P.a.createElement(X,{clusterName:e.name,serviceName:r,groupName:o}))})),P.a.createElement(I.a,{ref:this.editServiceDialog,openLoading:function(){return t.openLoading()},closeLoading:function(){return t.closeLoading()},getServiceDetail:function(){return t.getServiceDetail()}}),P.a.createElement(K,{ref:this.editClusterDialog,openLoading:function(){return t.openLoading()},closeLoading:function(){return t.closeLoading()},getServiceDetail:function(){return t.getServiceDetail()}}))}}]),a}(P.a.Component),p.displayName="ServiceDetail",f=h))||f;t.a=ne},function(e,t,d){"use strict";d(51);var n,a,r,o,i,s,l=d(30),y=d.n(l),u=(d(32),d(20)),v=d.n(u),c=(d(376),d(130)),_=d.n(c),f=(d(40),d(23)),b=d.n(f),p=(d(118),d(80)),w=d.n(p),h=(d(102),d(69)),M=d.n(h),m=(d(64),d(31)),k=d.n(m),g=(d(41),d(9)),S=d.n(g),E=(d(37),d(10)),L=d.n(E),x=(d(123),d(57)),T=d.n(x),C=d(58),D=d(21),O=(d(35),d(19)),N=d.n(O),Y=(d(52),d(28)),P=d.n(Y),j=d(14),I=d(15),R=d(17),A=d(16),H=(d(25),d(8)),F=d.n(H),z=(d(67),d(38)),W=d.n(z),V=d(0),B=d.n(V),U=d(1),K=d(47),G=d(36),q=d(129),J=d(96),$=(d(645),W.a.Row),Q=W.a.Col,X=(0,F.a.config)((r=a=function(e){Object(R.a)(a,e);var n=Object(A.a)(a);function a(e){var t;return Object(j.a)(this,a),(t=n.call(this,e)).diffeditor=B.a.createRef(),t.state={dialogvisible:!1},t}return Object(I.a)(a,[{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=B.a.createElement("div",null," ",B.a.createElement(v.a,{type:"primary",onClick:this.confirmPub.bind(this)},t.publish));return B.a.createElement("div",null,B.a.createElement(N.a,{title:t.contents,style:{width:"80%"},visible:this.state.dialogvisible,footer:n,onClose:this.closeDialog.bind(this)},B.a.createElement("div",{style:{height:400}},B.a.createElement("div",null,B.a.createElement($,null,B.a.createElement(Q,{style:{textAlign:"center"}},t.currentArea),B.a.createElement(Q,{style:{textAlign:"center"}},t.originalValue))),B.a.createElement("div",{style:{clear:"both",height:480},ref:this.diffeditor}))))}}]),a}(B.a.Component),a.displayName="DiffEditorDialog",n=r))||n,Z=(d(646),d(647),d(166),W.a.Row),ee=W.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,F.a.config)((s=i=function(e){Object(R.a)(a,e);var n=Object(A.a)(a);function a(e){var t;return Object(j.a)(this,a),(t=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=B.a.createRef(),t.diffEditorDialog=B.a.createRef(),t}return Object(I.a)(a,[{key:"componentDidMount",value:function(){var t=this,e=!Object(U.b)("dataId"),n=Object(U.b)("group").trim();this.setState({isNewConfig:e},function(){e?(n&&t.setState({group:n}),t.initMoacoEditor("text","")):t.changeForm({dataId:Object(U.b)("dataId").trim(),group:n},function(){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 r={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,r):window.importEditor(function(){n.monacoEditor=window.monaco.editor.create(a,r)})}},{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;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),r=this.monacoEditor?this.monacoEditor.getValue():a;return r||(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 r=this.getCodeVal();if(r)return q.a.validate({content:r,type:t})?this._publishConfig():new Promise(function(e,t){N.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(){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(){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(){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(){return"TODO"}},{key:"getCppCode",value:function(){return"TODO"}},{key:"getShellCode",value:function(){return"TODO"}},{key:"getPythonCode",value:function(){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=A.a.createElement("div",null);return A.a.createElement("div",null,A.a.createElement(g.a,{title:t.sampleCode,style:{width:"80%"},visible:this.state.dialogvisible,footer:n,onClose:this.closeDialog.bind(this)},A.a.createElement("div",{style:{height:500}},A.a.createElement(B.a,{tip:t.loading,style:{width:"100%"},visible:this.state.loading},A.a.createElement(K.a,{shape:"text",style:{height:40,paddingBottom:10}},A.a.createElement(G,{title:"Java",key:0,onClick:this.changeTab.bind(this,"commoneditor1",this.defaultCode)}),A.a.createElement(G,{title:"Spring",key:1,onClick:this.changeTab.bind(this,"commoneditor1",this.springCode)}),A.a.createElement(G,{title:"Spring Boot",key:2,onClick:this.changeTab.bind(this,"commoneditor2",this.sprigbootCode)}),A.a.createElement(G,{title:"Spring Cloud",key:21,onClick:this.changeTab.bind(this,"commoneditor21",this.sprigcloudCode)}),A.a.createElement(G,{title:"Node.js",key:3,onClick:this.changeTab.bind(this,"commoneditor3",this.nodejsCode)}),A.a.createElement(G,{title:"C++",key:4,onClick:this.changeTab.bind(this,"commoneditor4",this.cppCode)}),A.a.createElement(G,{title:"Shell",key:5,onClick:this.changeTab.bind(this,"commoneditor5",this.shellCode)}),A.a.createElement(G,{title:"Python",key:6,onClick:this.changeTab.bind(this,"commoneditor6",this.pythonCode)})),A.a.createElement("div",{ref:"codepreview"})))))}}]),a}(A.a.Component),r.displayName="ShowServiceCodeing",a=o))||a,J=(n(697),n(27)),$=I.a.Item,Q=P.a.Row,X=P.a.Col,Z=N.a.Column,ee=(0,D.a.config)((l=s=function(e){Object(M.a)(a,e);var t=Object(k.a)(a);function a(e){var n;return Object(_.a)(this,a),(n=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=A.a.createRef(),n.showcode=A.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(w.a)(n)),n}return Object(b.a)(a,[{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,r=e.withInstances,o=void 0!==r&&r,s=e.hasIpCount,l=["hasIpCount=".concat(s),"withInstances=".concat(o),"pageNo=".concat(t),"pageSize=".concat(n),"serviceNameParam=".concat(a.serviceName),"groupNameParam=".concat(a.groupName)];this.openLoading(),Object(H.c)({url:"v1/ns/catalog/services?".concat(l.join("&")),success:function(e){var t=0i&&S.a.createElement(d.a,{className:"users-pagination",current:s,total:n.totalCount,pageSize:i,onChange:function(e){return t.setState({pageNo:e},function(){return t.getUsers()})}}),S.a.createElement(A,{visible:l,onOk:function(e){return Object(L.c)(e).then(function(e){return t.setState({pageNo:1},function(){return t.getUsers()}),e})},onCancel:function(){return t.colseCreateUser()}}),S.a.createElement(H.a,{username:u,onOk:function(e){return Object(L.k)(e).then(function(e){return t.getUsers(),e})},onCancel:function(){return t.setState({passwordResetUser:void 0})}}))}}]),a}(S.a.Component),s.displayName="UserManagement",i=l))||i)||i;t.a=F},function(e,t,n){"use strict";n(61);var a,r,o,i,s,l,u=n(45),c=n.n(u),d=(n(35),n(19)),f=n.n(d),p=n(39),h=(n(60),n(13)),m=n.n(h),g=(n(32),n(20)),y=n.n(g),v=n(14),_=n(15),b=n(17),w=n(16),M=(n(25),n(8)),k=n.n(M),S=n(0),E=n.n(S),L=n(43),x=n(44),T=n(94),C=n(46),D=(n(49),n(26)),O=n.n(D),N=n(22),Y=(n(64),n(31)),P=n.n(Y),j=(n(41),n(9)),I=n.n(j),R=I.a.Item,A=P.a.Option,H={labelCol:{fixedSpan:4},wrapperCol:{span:19}},F=Object(L.b)(function(e){return{namespaces:e.namespace.namespaces}},{getNamespaces:T.b,searchRoles:x.l})(a=(0,k.a.config)((o=r=function(e){Object(b.a)(o,e);var r=Object(w.a)(o);function o(){var t;Object(v.a)(this,o);for(var e=arguments.length,n=new Array(e),a=0;as&&E.a.createElement(c.a,{className:"users-pagination",current:u,total:t.totalCount,pageSize:s,onChange:function(e){return a.setState({pageNo:e},function(){return a.getPermissions()})}}),E.a.createElement(F,{visible:d,onOk:function(e){return Object(x.a)(e).then(function(e){return a.setState({pageNo:1},function(){return a.getPermissions()}),e})},onCancel:function(){return a.colseCreatePermission()}}))}}]),a}(E.a.Component),s.displayName="PermissionsManagement",i=l))||i)||i);t.a=z},function(e,t,n){"use strict";n(61);var a,r,o,i,s,l,u=n(45),d=n.n(u),c=(n(35),n(19)),f=n.n(c),p=(n(60),n(13)),h=n.n(p),m=(n(32),n(20)),g=n.n(m),y=n(14),v=n(15),_=n(17),b=n(16),w=(n(25),n(8)),M=n.n(w),k=n(0),S=n.n(k),E=n(43),L=n(44),x=n(46),T=(n(64),n(31)),C=n.n(T),D=(n(37),n(10)),O=n.n(D),N=(n(49),n(26)),Y=n.n(N),P=n(22),j=(n(41),n(9)),I=n.n(j),R=I.a.Item,A={labelCol:{fixedSpan:4},wrapperCol:{span:19}},H=Object(E.b)(function(e){return{users:e.authority.users}},{searchUsers:L.m})(a=(0,M.a.config)((o=r=function(e){Object(_.a)(o,e);var r=Object(b.a)(o);function o(){var t;Object(y.a)(this,o);for(var e=arguments.length,n=new Array(e),a=0;ai&&S.a.createElement(d.a,{className:"users-pagination",current:s,total:t.totalCount,pageSize:i,onChange:function(e){return a.setState({pageNo:e},function(){return a.getRoles()})}}),S.a.createElement(H,{visible:l,onOk:function(e){return Object(L.b)(e).then(function(e){return a.getRoles(),e})},onCancel:function(){return a.colseCreateRole()}}))}}]),a}(S.a.Component),s.displayName="RolesManagement",i=l))||i)||i);t.a=F},function(e,t,n){"use strict";n(40);function s(e){var t=localStorage.token,n=void 0===t?"{}":t,a=Object(L.c)(n)&&JSON.parse(n)||{};return["naming"===e?void 0:x,{key:"serviceManagementVirtual",children:[{key:"serviceManagement",url:"/serviceManagement"},{key:"subscriberList",url:"/subscriberList"}]},a.globalAdmin?T:void 0,{key:"namespace",url:"/namespace"},{key:"clusterManagementVirtual",children:[{key:"clusterManagement",url:"/clusterManagement"}]}].filter(function(e){return e})}var a,r,o,i,l,u=n(23),d=n.n(u),c=n(14),f=n(15),p=n(17),h=n(16),m=(n(25),n(8)),g=n.n(m),y=n(21),v=(n(79),n(50)),_=n.n(v),b=n(0),w=n.n(b),M=n(33),k=n(43),S=n(126),E=n(92),L=n(47),x={key:"configurationManagementVirtual",children:[{key:"configurationManagement",url:"/configurationManagement"},{key:"historyRollback",url:"/historyRollback"},{key:"listeningToQuery",url:"/listeningToQuery"}]},T={key:"authorityControl",children:[{key:"userList",url:"/userManagement"},{key:"roleManagement",url:"/rolesManagement"},{key:"privilegeManagement",url:"/permissionsManagement"}]},C=_.a.SubMenu,D=_.a.Item,O=(a=Object(k.b)(function(e){return Object(y.a)(Object(y.a)({},e.locale),e.base)},{getState:E.b}),r=g.a.config,Object(M.g)(o=a(o=r((l=i=function(e){Object(p.a)(n,e);var t=Object(h.a)(n);function n(){return Object(c.a)(this,n),t.apply(this,arguments)}return Object(f.a)(n,[{key:"componentDidMount",value:function(){this.props.getState()}},{key:"goBack",value:function(){this.props.history.goBack()}},{key:"navTo",value:function(e){var t=this.props.location.search;this.props.history.push([e,t].join(""))}},{key:"isCurrentPath",value:function(e){return e===this.props.location.pathname?"current-path":void 0}},{key:"defaultOpenKeys",value:function(){for(var t=this,e=s(this.props.functionMode),n=0,a=e.length;nthis.state.pageSize&&Y.a.createElement("div",{style:{marginTop:10,textAlign:"right"}},Y.a.createElement(E.a,{current:this.state.pageNo,total:s,pageSize:this.state.pageSize,onChange:function(e){return t.setState({pageNo:e},function(){return t.querySubscriberList()})}}))))}}]),a}(Y.a.Component),r.displayName="SubscriberList",a=o))||a)||a;t.a=z},function(e,t,n){"use strict";n(51);var a,r,o,i=n(30),m=n.n(i),s=(n(61),n(45)),g=n.n(s),l=(n(377),n(98)),y=n.n(l),u=(n(32),n(20)),v=n.n(u),d=(n(37),n(10)),_=n.n(d),c=(n(49),n(26)),f=n.n(c),p=n(14),h=n(15),b=n(22),w=n(17),M=n(16),k=(n(25),n(8)),S=n.n(k),E=(n(385),n(99)),L=n.n(E),x=(n(60),n(13)),T=n.n(x),C=(n(67),n(38)),D=n.n(C),O=(n(41),n(9)),N=n.n(O),Y=n(0),P=n.n(Y),j=n(1),I=n(46),R=(n(700),N.a.Item),A=D.a.Row,H=D.a.Col,F=T.a.Column,z=L.a.Panel,W=(0,S.a.config)((o=r=function(e){Object(w.a)(a,e);var t=Object(M.a)(a);function a(e){var n;return Object(p.a)(this,a),(n=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 f.a(Object(b.a)(n)),n}return Object(h.a)(a,[{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,r=e.withInstances,o=["withInstances=".concat(void 0!==r&&r),"pageNo=".concat(t),"pageSize=".concat(n),"keyword=".concat(a)];Object(j.c)({url:"v1/core/cluster/nodes?".concat(o.join("&")),beforeSend:function(){return i.openLoading()},success:function(e){var t=0this.state.pageSize&&P.a.createElement("div",{style:{marginTop:10,textAlign:"right"}},P.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()})}}))))}}]),a}(P.a.Component),r.displayName="ClusterNodeList",a=o))||a;t.a=W},function(e,t,q){"use strict";q.r(t),function(e){q(51);var t,n=q(30),r=q.n(n),a=(q(25),q(8)),o=q.n(a),i=q(14),s=q(15),l=q(17),u=q(16),d=q(21),c=q(0),f=q.n(c),p=q(24),h=q.n(p),m=q(82),g=q(394),y=q(395),v=q(43),_=q(33),b=q(91),w=(q(439),q(413)),M=q(27),k=q(414),S=q(406),E=q(415),L=q(416),x=q(417),T=q(408),C=q(418),D=q(419),O=q(420),N=q(421),Y=q(405),P=q(409),j=q(407),I=q(422),R=q(423),A=q(410),H=q(411),F=q(412),z=q(403),W=q(404),V=q(95);q(703);e.hot,localStorage.getItem(M.f)||localStorage.setItem(M.f,"zh-CN"===navigator.language?"zh-CN":"en-US");var B=Object(m.c)(Object(d.a)(Object(d.a)({},W.a),{},{routing:g.routerReducer})),U=Object(m.e)(B,Object(m.d)(Object(m.a)(y.a),window[M.i]?window[M.i]():function(e){return e})),K=[{path:"/",exact:!0,render:function(){return f.a.createElement(_.a,{to:"/welcome"})}},{path:"/welcome",component:z.a},{path:"/namespace",component:S.a},{path:"/newconfig",component:E.a},{path:"/configsync",component:L.a},{path:"/configdetail",component:x.a},{path:"/configeditor",component:T.a},{path:"/historyDetail",component:C.a},{path:"/configRollback",component:D.a},{path:"/historyRollback",component:O.a},{path:"/listeningToQuery",component:N.a},{path:"/configurationManagement",component:Y.a},{path:"/serviceManagement",component:P.a},{path:"/serviceDetail",component:j.a},{path:"/subscriberList",component:I.a},{path:"/clusterManagement",component:R.a},{path:"/userManagement",component:A.a},{path:"/rolesManagement",component:F.a},{path:"/permissionsManagement",component:H.a}],G=Object(v.b)(function(e){return Object(d.a)({},e.locale)},{changeLanguage:V.a})(t=function(e){Object(l.a)(a,e);var n=Object(u.a)(a);function a(e){var t;return Object(i.a)(this,a),(t=n.call(this,e)).state={shownotice:"none",noticecontent:"",nacosLoading:{}},t}return Object(s.a)(a,[{key:"componentDidMount",value:function(){var e=localStorage.getItem(M.f);this.props.changeLanguage(e)}},{key:"render",value:function(){var e=this.props.locale;return f.a.createElement(r.a,Object.assign({className:"nacos-loading",shape:"flower",tip:"loading...",visible:!1,fullScreen:!0},this.state.nacosLoading),f.a.createElement(o.a,{locale:e},this.router))}},{key:"router",get:function(){return f.a.createElement(b.a,null,f.a.createElement(_.d,null,f.a.createElement(_.b,{path:"/login",component:k.a}),f.a.createElement(w.a,null,K.map(function(e){return f.a.createElement(_.b,Object.assign({key:e.path},e))}))))}}]),a}(f.a.Component))||t;h.a.render(f.a.createElement(v.a,{store:U},f.a.createElement(G,null)),document.getElementById("root"))}.call(this,q(170)(e))},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict"; +var t;e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){if(e===12){e=0}if(t==="凌晨"||t==="早上"||t==="上午"){return e}else if(t==="中午"){return e>=11?e:e+12}else if(t==="下午"||t==="晚上"){return e+12}},meridiem:function(e,t,n){var a=e*100+t;if(a<600){return"凌晨"}else if(a<900){return"早上"}else if(a<1130){return"上午"}else if(a<1230){return"中午"}else if(a<1800){return"下午"}else{return"晚上"}},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n(7))},function(e,t,n){"use strict";t.__esModule=!0;var a,r,w=p(n(4)),o=p(n(3)),i=p(n(5)),s=p(n(6)),l=n(0),M=p(l),u=p(n(2)),d=n(29),k=p(n(12)),c=p(n(42)),S=p(n(23)),E=p(n(116)),f=p(n(8)),L=n(11);function p(e){return e&&e.__esModule?e:{default:e}}function h(){}var m,g=(m=l.Component,(0,s.default)(x,m),x.getDerivedStateFromProps=function(e){return"visible"in e?{visible:e.visible}:{}},x.prototype.render=function(){var e,t=this.props,n=t.prefix,a=(t.pure,t.className),r=t.style,o=t.type,i=t.shape,s=t.size,l=t.title,u=t.children,d=(t.defaultVisible,t.visible,t.iconType),c=t.closeable,f=(t.onClose,t.afterClose),p=t.animation,h=t.rtl,m=t.locale,g=(0,w.default)({},L.obj.pickOthers(Object.keys(x.propTypes),this.props)),y=this.state.visible,v=n+"message",_=(0,k.default)(((e={})[v]=!0,e[n+"message-"+o]=o,e[""+n+i]=i,e[""+n+s]=s,e[n+"title-content"]=!!l,e[n+"only-content"]=!l&&!!u,e[a]=a,e)),b=y?M.default.createElement("div",(0,w.default)({role:"alert",style:r},g,{className:_,dir:h?"rtl":void 0}),c?M.default.createElement("a",{role:"button","aria-label":m.closeAriaLabel,className:v+"-close",onClick:this.onClose},M.default.createElement(S.default,{type:"close"})):null,M.default.createElement(S.default,{className:v+"-symbol "+(!d&&v+"-symbol-icon"),type:d}),l?M.default.createElement("div",{className:v+"-title"},l):null,u?M.default.createElement("div",{className:v+"-content"},u):null):null;return p?M.default.createElement(E.default.Expand,{animationAppear:!1,afterLeave:f},b):b},r=a=x,a.propTypes={prefix:u.default.string,pure:u.default.bool,className:u.default.string,style:u.default.object,type:u.default.oneOf(["success","warning","error","notice","help","loading"]),shape:u.default.oneOf(["inline","addon","toast"]),size:u.default.oneOf(["medium","large"]),title:u.default.node,children:u.default.node,defaultVisible:u.default.bool,visible:u.default.bool,iconType:u.default.string,closeable:u.default.bool,onClose:u.default.func,afterClose:u.default.func,animation:u.default.bool,locale:u.default.object,rtl:u.default.bool},a.defaultProps={prefix:"next-",pure:!1,type:"success",shape:"inline",size:"medium",defaultVisible:!0,closeable:!1,onClose:h,afterClose:h,animation:!0,locale:c.default.Message},r);function x(){var e,t;(0,o.default)(this,x);for(var n=arguments.length,a=Array(n),r=0;re.clientHeight&&0this.popupNode.offsetWidth&&m(this.popupNode,"width",e.offsetWidth+"px"),"outside"!==d||"hoz"===u&&1===a||(m(this.popupNode,"height",p.offsetHeight+"px"),m(this.popupNode,"overflow-y","scroll"));var h=this.popupProps;h.onOpen&&h.onOpen()},j.prototype.handlePopupClose=function(){var e=this.props.root.popupNodes,t=e.indexOf(this.popupNode);-1 "+this.message+" (line "+this.parsedLine+": '"+this.snippet+"')":" "+this.message},e.exports=n},function(e,t){var r={}.hasOwnProperty;function n(e,t,n){this.message=e,this.parsedLine=t,this.snippet=n}(function(e,t){for(var n in t)r.call(t,n)&&(e[n]=t[n]);function a(){this.constructor=e}a.prototype=t.prototype,e.prototype=new a,e.__super__=t.prototype})(n,Error),n.prototype.toString=function(){return null!=this.parsedLine&&null!=this.snippet?" "+this.message+" (line "+this.parsedLine+": '"+this.snippet+"')":" "+this.message},e.exports=n},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var a,r,S=m(n(4)),o=m(n(3)),i=m(n(5)),s=m(n(6)),l=n(0),E=m(l),u=n(24),d=m(n(2)),L=m(n(12)),c=n(11),v=m(n(50)),f=m(n(63)),x=m(n(10)),p=m(n(42)),h=m(n(631)),_=m(n(382)),b=n(160);function m(e){return e&&e.__esModule?e:{default:e}}var T=f.default.Popup,g=v.default.Item,y=v.default.Group,w=c.func.noop,M=c.func.bindCtx,C=c.func.makeChain;function k(e){e.preventDefault()}var D,O=(D=E.default.Component,(0,s.default)(N,D),N.prototype.componentDidMount=function(){var e=this;setTimeout(function(){return e.syncWidth()},0),c.events.on(window,"resize",this.handleResize)},N.prototype.componentDidUpdate=function(e,t){e.label===this.props.label&&t.value===this.state.value||this.syncWidth()},N.prototype.componentWillUnmount=function(){c.events.off(window,"resize",this.handleResize),clearTimeout(this.resizeTimeout)},N.prototype.syncWidth=function(){var e,t=this,n=this.props,a=n.popupStyle,r=n.popupProps;a&&"width"in a||r&&r.style&&"width"in r.style||(e=c.dom.getStyle(this.selectDOM,"width"))&&this.width!==e&&(this.width=e,this.popupRef&&this.shouldAutoWidth()&&setTimeout(function(){t.popupRef&&t.popupRef.getInstance().overlay&&c.dom.setStyle(t.popupRef.getInstance().overlay.getInstance().getContentNode(),"width",t.width)},0))},N.prototype.handleResize=function(){var e=this;clearTimeout(this.resizeTimeout),this.state.visible&&(this.resizeTimeout=setTimeout(function(){e.syncWidth()},200))},N.prototype.setDataSource=function(e){var t=e.dataSource,n=e.children;return l.Children.count(n)?this.dataStore.updateByDS(n,!0):Array.isArray(t)?this.dataStore.updateByDS(t,!1):[]},N.prototype.setVisible=function(e,t){this.props.disabled||this.state.visible===e||("visible"in this.props||this.setState({visible:e}),this.props.onVisibleChange(e,t))},N.prototype.setFirstHightLightKeyForMenu=function(){var e;this.props.autoHighlightFirstItem&&this.dataStore.getMenuDS().length&&this.dataStore.getEnableDS().length&&(e=""+this.dataStore.getEnableDS()[0].value,this.setState({highlightKey:e}),this.props.onToggleHighlightItem(e,"autoFirstItem"))},N.prototype.handleChange=function(e){var t;"value"in this.props||this.setState({value:e});for(var n=arguments.length,a=Array(1e.slidesToShow&&(a=e.slideWidth*e.slidesToShow*-1,i=e.slideHeight*e.slidesToShow*-1),e.slideCount%e.slidesToScroll!=0&&(t=e.slideIndex+e.slidesToScroll>e.slideCount&&e.slideCount>e.slidesToShow,e.rtl&&(t=(e.slideIndex>=e.slideCount?e.slideCount-e.slideIndex:e.slideIndex)+e.slidesToScroll>e.slideCount&&e.slideCount>e.slidesToShow),t&&(i=e.slideIndex>e.slideCount?(a=(e.slidesToShow-(e.slideIndex-e.slideCount))*e.slideWidth*-1,(e.slidesToShow-(e.slideIndex-e.slideCount))*e.slideHeight*-1):(a=e.slideCount%e.slidesToScroll*e.slideWidth*-1,e.slideCount%e.slidesToScroll*e.slideHeight*-1)))):e.slideCount%e.slidesToScroll!=0&&e.slideIndex+e.slidesToScroll>e.slideCount&&e.slideCount>e.slidesToShow&&(a=(e.slidesToShow-e.slideCount%e.slidesToScroll)*e.slideWidth),e.centerMode&&(e.infinite?a+=e.slideWidth*Math.floor(e.slidesToShow/2):a=e.slideWidth*Math.floor(e.slidesToShow/2)),r=e.vertical?e.slideIndex*e.slideHeight*-1+i:e.slideIndex*e.slideWidth*-1+a,!0===e.variableWidth&&(n=void 0,r=(o=e.slideCount<=e.slidesToShow||!1===e.infinite?s.default.findDOMNode(e.trackRef).childNodes[e.slideIndex]:(n=e.slideIndex+e.slidesToShow,s.default.findDOMNode(e.trackRef).childNodes[n]))?-1*o.offsetLeft:0,!0===e.centerMode&&(o=!1===e.infinite?s.default.findDOMNode(e.trackRef).children[e.slideIndex]:s.default.findDOMNode(e.trackRef).children[e.slideIndex+e.slidesToShow+1])&&(r=-1*o.offsetLeft+(e.listWidth-o.offsetWidth)/2)),r)}},function(e,t,n){"use strict";t.__esModule=!0;var a,r,y=c(n(4)),v=c(n(18)),o=c(n(3)),i=c(n(5)),s=c(n(6)),_=c(n(0)),l=c(n(2)),b=c(n(12)),u=c(n(8)),w=c(n(23)),d=n(11);function c(e){return e&&e.__esModule?e:{default:e}}var f,p=(f=_.default.Component,(0,s.default)(h,f),h.prototype.render=function(){var e,t,n=this.props,a=n.title,r=n.children,o=n.className,i=n.isExpanded,s=n.disabled,l=n.style,u=n.prefix,d=n.onClick,c=n.id,f=(0,v.default)(n,["title","children","className","isExpanded","disabled","style","prefix","onClick","id"]),p=(0,b.default)(((e={})[u+"collapse-panel"]=!0,e[u+"collapse-panel-hidden"]=!i,e[u+"collapse-panel-expanded"]=i,e[u+"collapse-panel-disabled"]=s,e[o]=o,e)),h=(0,b.default)(((t={})[u+"collapse-panel-icon"]=!0,t[u+"collapse-panel-icon-expanded"]=i,t)),m=c?c+"-heading":void 0,g=c?c+"-region":void 0;return _.default.createElement("div",(0,y.default)({className:p,style:l,id:c},f),_.default.createElement("div",{id:m,className:u+"collapse-panel-title",onClick:d,onKeyDown:this.onKeyDown,tabIndex:"0","aria-disabled":s,"aria-expanded":i,"aria-controls":g,role:"button"},_.default.createElement(w.default,{type:"arrow-right",className:h,"aria-hidden":"true"}),a),_.default.createElement("div",{className:u+"collapse-panel-content",role:"region",id:g},r))},r=a=h,a.propTypes={prefix:l.default.string,style:l.default.object,children:l.default.any,isExpanded:l.default.bool,disabled:l.default.bool,title:l.default.node,className:l.default.string,onClick:l.default.func,id:l.default.string},a.defaultProps={prefix:"next-",isExpanded:!1,onClick:d.func.noop},a.isNextPanel=!0,r);function h(){var e,n;(0,o.default)(this,h);for(var t=arguments.length,a=Array(t),r=0;r\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\n\t\tboolean isPublishOk = configService.publishConfig(dataId, group, "content");\n\t\tSystem.out.println(isPublishOk);\n\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(){return"TODO"}},{key:"getCppCode",value:function(){return"TODO"}},{key:"getShellCode",value:function(){return"TODO"}},{key:"getPythonCode",value:function(){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=Z.a.createElement("div",null);return Z.a.createElement("div",null,Z.a.createElement(F.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(ie.a,{tip:t.loading,style:{width:"100%"},visible:this.state.loading},Z.a.createElement(le.a,{shape:"text",style:{height:40,paddingBottom:10}},Z.a.createElement(ue,{title:"Java",key:1,onClick:this.changeTab.bind(this,"commoneditor1",this.defaultCode)}),Z.a.createElement(ue,{title:"Spring Boot",key:2,onClick:this.changeTab.bind(this,"commoneditor2",this.sprigboot_code)}),Z.a.createElement(ue,{title:"Spring Cloud",key:21,onClick:this.changeTab.bind(this,"commoneditor21",this.sprigcloud_code)}),Z.a.createElement(ue,{title:"Node.js",key:3,onClick:this.changeTab.bind(this,"commoneditor3",this.nodejsCode)}),Z.a.createElement(ue,{title:"C++",key:4,onClick:this.changeTab.bind(this,"commoneditor4",this.cppCode)}),Z.a.createElement(ue,{title:"Shell",key:5,onClick:this.changeTab.bind(this,"commoneditor5",this.shellCode)}),Z.a.createElement(ue,{title:"Python",key:6,onClick:this.changeTab.bind(this,"commoneditor6",this.pythonCode)})),Z.a.createElement("div",{ref:"codepreview"})))))}}]),a}(Z.a.Component),r.displayName="ShowCodeing",a=o))||a,ce=(n(67),n(38)),fe=n.n(ce),pe=(n(674),fe.a.Row),he=fe.a.Col,me=(0,J.a.config)((l=s=function(e){Object(K.a)(a,e);var n=Object(G.a)(a);function a(e){var t;return Object(V.a)(this,a),(t=n.call(this,e)).state={visible:!1,title:"",content:"",isok:!0,dataId:"",group:""},t}return Object(B.a)(a,[{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=Z.a.createElement("div",{style:{textAlign:"right"}},Z.a.createElement(M.a,{type:"primary",onClick:this.closeDialog.bind(this)},t.determine));return Z.a.createElement("div",null,Z.a.createElement(F.a,{visible:this.state.visible,footer:n,style:{width:555},onCancel:this.closeDialog.bind(this),onClose:this.closeDialog.bind(this),title:t.deletetitle},Z.a.createElement("div",null,Z.a.createElement(pe,null,Z.a.createElement(he,{span:"4",style:{paddingTop:16}},Z.a.createElement(I.a,{type:"".concat(this.state.isok?"success":"delete","-filling"),style:{color:this.state.isok?"green":"red"},size:"xl"})),Z.a.createElement(he,{span:"20"},Z.a.createElement("div",null,Z.a.createElement("h3",null,this.state.isok?t.deletedSuccessfully:t.deleteFailed),Z.a.createElement("p",null,Z.a.createElement("span",{style:{color:"#999",marginRight:5}},"Data ID:"),Z.a.createElement("span",{style:{color:"#c7254e"}},this.state.dataId)),Z.a.createElement("p",null,Z.a.createElement("span",{style:{color:"#999",marginRight:5}},"Group:"),Z.a.createElement("span",{style:{color:"#c7254e"}},this.state.group)),this.state.isok?"":Z.a.createElement("p",{style:{color:"red"}},this.state.message)))))))}}]),a}(Z.a.Component),s.displayName="DeleteDialog",i=l))||i,ge=(n(675),n(401)),ye=n.n(ge),ve=(0,J.a.config)((c=d=function(e){Object(K.a)(n,e);var t=Object(G.a)(n);function n(){return Object(V.a)(this,n),t.apply(this,arguments)}return Object(B.a)(n,[{key:"render",value:function(){var e=this.props,t=e.data,n=void 0===t?{}:t,a=e.height,r=e.locale,o=void 0===r?{}:r;return Z.a.createElement("div",null,"notice"===n.modeType?Z.a.createElement("div",{"data-spm-click":"gostr=/aliyun;locaid=notice"},Z.a.createElement(ye.a,{style:{marginBottom:1u?P.a.createElement(q.a,{className:"pagination",total:l.count,pageSize:u,onChange:function(e){return a.onChangePage(e)}}):null,P.a.createElement(Q,{ref:this.editInstanceDialog,serviceName:o,clusterName:n,groupName:i,openLoading:function(){return a.openLoading()},closeLoading:function(){return a.closeLoading()},getInstanceList:function(){return a.getInstanceList()}})):null}}]),a}(P.a.Component),d.displayName="InstanceTable",u=c))||u,Z=n(47),ee=(n(698),N.a.Item),te={labelCol:{fixedSpan:10},wrapperCol:{span:14}},ne=(0,D.a.config)((h=p=function(e){Object(x.a)(a,e);var n=Object(T.a)(a);function a(e){var t;return Object(E.a)(this,a),(t=n.call(this,e)).editServiceDialog=P.a.createRef(),t.editClusterDialog=P.a.createRef(),t.state={serviceName:Object(Z.b)(e.location.search,"name"),groupName:Object(Z.b)(e.location.search,"groupName"),loading:!1,currentPage:1,clusters:[],instances:{},service:{},pageSize:10,pageNum:{}},t}return Object(L.a)(a,[{key:"componentDidMount",value:function(){this.state.serviceName?this.getServiceDetail():this.props.history.goBack()}},{key:"getServiceDetail",value:function(){var o=this,e=this.state,t=e.serviceName,n=e.groupName;Object(j.c)({url:"v1/ns/catalog/service?serviceName=".concat(t,"&groupName=").concat(n),beforeSend:function(){return o.openLoading()},success:function(e){var t=e.clusters,n=void 0===t?[]:t,a=e.service,r=void 0===a?{}:a;return o.setState({service:r,clusters:n})},error:function(e){return k.a.error(e.responseText||"error")},complete:function(){return o.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,r=a.serviceName,o=a.groupName,i=a.loading,s=a.service,l=void 0===s?{}:s,u=a.clusters,d=l.metadata,c=void 0===d?{}:d,f=l.selector,p=void 0===f?{}:f,h="";return Object.keys(c).length&&(h=JSON.stringify(c,null,"\t")),P.a.createElement("div",{className:"main-container service-detail"},P.a.createElement(g.a,{shape:"flower",tip:"Loading...",className:"loading",visible:i,color:"#333"},P.a.createElement("h1",{style:{position:"relative",width:"100%"}},n.serviceDetails,P.a.createElement(w.a,{type:"primary",className:"header-btn",onClick:function(){return t.props.history.goBack()}},n.back),P.a.createElement(w.a,{type:"normal",className:"header-btn",onClick:function(){return t.openEditServiceDialog()}},n.editService)),P.a.createElement(N.a,te,P.a.createElement(ee,{label:"".concat(n.serviceName,":")},P.a.createElement(S.a,{value:l.name,readOnly:!0})),P.a.createElement(ee,{label:"".concat(n.groupName,":")},P.a.createElement(S.a,{value:l.groupName,readOnly:!0})),P.a.createElement(ee,{label:"".concat(n.protectThreshold,":")},P.a.createElement(S.a,{value:l.protectThreshold,readOnly:!0})),P.a.createElement(ee,{label:"".concat(n.metadata,":")},P.a.createElement(U.a,{language:"json",width:"100%",height:200,value:h,options:B.c})),P.a.createElement(ee,{label:"".concat(n.type,":")},P.a.createElement(S.a,{value:p.type,readOnly:!0})),"label"===l.type&&P.a.createElement(ee,{label:"".concat(n.selector,":")},P.a.createElement(S.a,{value:p.selector,readOnly:!0}))),u.map(function(e){return P.a.createElement(v.a,{key:e.name,className:"cluster-card",title:"".concat(n.cluster,":"),subTitle:e.name,contentHeight:"auto",extra:P.a.createElement(w.a,{type:"normal",onClick:function(){return t.openClusterDialog(e)}},n.editCluster)},P.a.createElement(X,{clusterName:e.name,serviceName:r,groupName:o}))})),P.a.createElement(I.a,{ref:this.editServiceDialog,openLoading:function(){return t.openLoading()},closeLoading:function(){return t.closeLoading()},getServiceDetail:function(){return t.getServiceDetail()}}),P.a.createElement(K,{ref:this.editClusterDialog,openLoading:function(){return t.openLoading()},closeLoading:function(){return t.closeLoading()},getServiceDetail:function(){return t.getServiceDetail()}}))}}]),a}(P.a.Component),p.displayName="ServiceDetail",f=h))||f;t.a=ne},function(e,t,d){"use strict";d(51);var n,a,r,o,i,s,l=d(30),y=d.n(l),u=(d(32),d(20)),v=d.n(u),c=(d(376),d(130)),_=d.n(c),f=(d(40),d(23)),b=d.n(f),p=(d(118),d(80)),w=d.n(p),h=(d(102),d(69)),M=d.n(h),m=(d(64),d(31)),k=d.n(m),g=(d(41),d(9)),S=d.n(g),E=(d(37),d(10)),L=d.n(E),x=(d(123),d(57)),T=d.n(x),C=d(58),D=d(21),O=(d(35),d(19)),N=d.n(O),Y=(d(52),d(28)),P=d.n(Y),j=d(14),I=d(15),R=d(17),A=d(16),H=(d(25),d(8)),F=d.n(H),z=(d(67),d(38)),W=d.n(z),V=d(0),B=d.n(V),U=d(1),K=d(47),G=d(36),q=d(129),J=d(96),$=(d(645),W.a.Row),Q=W.a.Col,X=(0,F.a.config)((r=a=function(e){Object(R.a)(a,e);var n=Object(A.a)(a);function a(e){var t;return Object(j.a)(this,a),(t=n.call(this,e)).diffeditor=B.a.createRef(),t.state={dialogvisible:!1},t}return Object(I.a)(a,[{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=B.a.createElement("div",null," ",B.a.createElement(v.a,{type:"primary",onClick:this.confirmPub.bind(this)},t.publish));return B.a.createElement("div",null,B.a.createElement(N.a,{title:t.contents,style:{width:"80%"},visible:this.state.dialogvisible,footer:n,onClose:this.closeDialog.bind(this)},B.a.createElement("div",{style:{height:400}},B.a.createElement("div",null,B.a.createElement($,null,B.a.createElement(Q,{style:{textAlign:"center"}},t.currentArea),B.a.createElement(Q,{style:{textAlign:"center"}},t.originalValue))),B.a.createElement("div",{style:{clear:"both",height:480},ref:this.diffeditor}))))}}]),a}(B.a.Component),a.displayName="DiffEditorDialog",n=r))||n,Z=(d(646),d(647),d(166),W.a.Row),ee=W.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,F.a.config)((s=i=function(e){Object(R.a)(a,e);var n=Object(A.a)(a);function a(e){var t;return Object(j.a)(this,a),(t=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=B.a.createRef(),t.diffEditorDialog=B.a.createRef(),t}return Object(I.a)(a,[{key:"componentDidMount",value:function(){var t=this,e=!Object(U.b)("dataId"),n=Object(U.b)("group").trim();this.setState({isNewConfig:e},function(){e?(n&&t.setState({group:n}),t.initMoacoEditor("text","")):t.changeForm({dataId:Object(U.b)("dataId").trim(),group:n},function(){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 r={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,r):window.importEditor(function(){n.monacoEditor=window.monaco.editor.create(a,r)})}},{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;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),r=this.monacoEditor?this.monacoEditor.getValue():a;return r||(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 r=this.getCodeVal();if(r)return q.a.validate({content:r,type:t})?this._publishConfig():new Promise(function(e,t){N.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(){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(){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(){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(){return"TODO"}},{key:"getCppCode",value:function(){return"TODO"}},{key:"getShellCode",value:function(){return"TODO"}},{key:"getPythonCode",value:function(){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=A.a.createElement("div",null);return A.a.createElement("div",null,A.a.createElement(g.a,{title:t.sampleCode,style:{width:"80%"},visible:this.state.dialogvisible,footer:n,onClose:this.closeDialog.bind(this)},A.a.createElement("div",{style:{height:500}},A.a.createElement(B.a,{tip:t.loading,style:{width:"100%"},visible:this.state.loading},A.a.createElement(K.a,{shape:"text",style:{height:40,paddingBottom:10}},A.a.createElement(G,{title:"Java",key:0,onClick:this.changeTab.bind(this,"commoneditor1",this.defaultCode)}),A.a.createElement(G,{title:"Spring",key:1,onClick:this.changeTab.bind(this,"commoneditor1",this.springCode)}),A.a.createElement(G,{title:"Spring Boot",key:2,onClick:this.changeTab.bind(this,"commoneditor2",this.sprigbootCode)}),A.a.createElement(G,{title:"Spring Cloud",key:21,onClick:this.changeTab.bind(this,"commoneditor21",this.sprigcloudCode)}),A.a.createElement(G,{title:"Node.js",key:3,onClick:this.changeTab.bind(this,"commoneditor3",this.nodejsCode)}),A.a.createElement(G,{title:"C++",key:4,onClick:this.changeTab.bind(this,"commoneditor4",this.cppCode)}),A.a.createElement(G,{title:"Shell",key:5,onClick:this.changeTab.bind(this,"commoneditor5",this.shellCode)}),A.a.createElement(G,{title:"Python",key:6,onClick:this.changeTab.bind(this,"commoneditor6",this.pythonCode)})),A.a.createElement("div",{ref:"codepreview"})))))}}]),a}(A.a.Component),r.displayName="ShowServiceCodeing",a=o))||a,J=(n(697),n(27)),$=I.a.Item,Q=P.a.Row,X=P.a.Col,Z=N.a.Column,ee=(0,D.a.config)((l=s=function(e){Object(M.a)(a,e);var t=Object(k.a)(a);function a(e){var n;return Object(_.a)(this,a),(n=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=A.a.createRef(),n.showcode=A.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(w.a)(n)),n}return Object(b.a)(a,[{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,r=e.withInstances,o=void 0!==r&&r,s=e.hasIpCount,l=["hasIpCount=".concat(s),"withInstances=".concat(o),"pageNo=".concat(t),"pageSize=".concat(n),"serviceNameParam=".concat(a.serviceName),"groupNameParam=".concat(a.groupName)];this.openLoading(),Object(H.c)({url:"v1/ns/catalog/services?".concat(l.join("&")),success:function(e){var t=0i&&S.a.createElement(d.a,{className:"users-pagination",current:s,total:n.totalCount,pageSize:i,onChange:function(e){return t.setState({pageNo:e},function(){return t.getUsers()})}}),S.a.createElement(A,{visible:l,onOk:function(e){return Object(L.c)(e).then(function(e){return t.setState({pageNo:1},function(){return t.getUsers()}),e})},onCancel:function(){return t.colseCreateUser()}}),S.a.createElement(H.a,{username:u,onOk:function(e){return Object(L.k)(e).then(function(e){return t.getUsers(),e})},onCancel:function(){return t.setState({passwordResetUser:void 0})}}))}}]),a}(S.a.Component),s.displayName="UserManagement",i=l))||i)||i;t.a=F},function(e,t,n){"use strict";n(61);var a,r,o,i,s,l,u=n(45),c=n.n(u),d=(n(35),n(19)),f=n.n(d),p=n(39),h=(n(60),n(13)),m=n.n(h),g=(n(32),n(20)),y=n.n(g),v=n(14),_=n(15),b=n(17),w=n(16),M=(n(25),n(8)),k=n.n(M),S=n(0),E=n.n(S),L=n(43),x=n(44),T=n(94),C=n(46),D=(n(49),n(26)),O=n.n(D),N=n(22),Y=(n(64),n(31)),P=n.n(Y),j=(n(41),n(9)),I=n.n(j),R=I.a.Item,A=P.a.Option,H={labelCol:{fixedSpan:4},wrapperCol:{span:19}},F=Object(L.b)(function(e){return{namespaces:e.namespace.namespaces}},{getNamespaces:T.b,searchRoles:x.l})(a=(0,k.a.config)((o=r=function(e){Object(b.a)(o,e);var r=Object(w.a)(o);function o(){var t;Object(v.a)(this,o);for(var e=arguments.length,n=new Array(e),a=0;as&&E.a.createElement(c.a,{className:"users-pagination",current:u,total:t.totalCount,pageSize:s,onChange:function(e){return a.setState({pageNo:e},function(){return a.getPermissions()})}}),E.a.createElement(F,{visible:d,onOk:function(e){return Object(x.a)(e).then(function(e){return a.setState({pageNo:1},function(){return a.getPermissions()}),e})},onCancel:function(){return a.colseCreatePermission()}}))}}]),a}(E.a.Component),s.displayName="PermissionsManagement",i=l))||i)||i);t.a=z},function(e,t,n){"use strict";n(61);var a,r,o,i,s,l,u=n(45),d=n.n(u),c=(n(35),n(19)),f=n.n(c),p=(n(60),n(13)),h=n.n(p),m=(n(32),n(20)),g=n.n(m),y=n(14),v=n(15),_=n(17),b=n(16),w=(n(25),n(8)),M=n.n(w),k=n(0),S=n.n(k),E=n(43),L=n(44),x=n(46),T=(n(64),n(31)),C=n.n(T),D=(n(37),n(10)),O=n.n(D),N=(n(49),n(26)),Y=n.n(N),P=n(22),j=(n(41),n(9)),I=n.n(j),R=I.a.Item,A={labelCol:{fixedSpan:4},wrapperCol:{span:19}},H=Object(E.b)(function(e){return{users:e.authority.users}},{searchUsers:L.m})(a=(0,M.a.config)((o=r=function(e){Object(_.a)(o,e);var r=Object(b.a)(o);function o(){var t;Object(y.a)(this,o);for(var e=arguments.length,n=new Array(e),a=0;ai&&S.a.createElement(d.a,{className:"users-pagination",current:s,total:t.totalCount,pageSize:i,onChange:function(e){return a.setState({pageNo:e},function(){return a.getRoles()})}}),S.a.createElement(H,{visible:l,onOk:function(e){return Object(L.b)(e).then(function(e){return a.getRoles(),e})},onCancel:function(){return a.colseCreateRole()}}))}}]),a}(S.a.Component),s.displayName="RolesManagement",i=l))||i)||i);t.a=F},function(e,t,n){"use strict";n(40);function s(e){var t=localStorage.token,n=void 0===t?"{}":t,a=Object(L.c)(n)&&JSON.parse(n)||{};return["naming"===e?void 0:x,{key:"serviceManagementVirtual",children:[{key:"serviceManagement",url:"/serviceManagement"},{key:"subscriberList",url:"/subscriberList"}]},a.globalAdmin?T:void 0,{key:"namespace",url:"/namespace"},{key:"clusterManagementVirtual",children:[{key:"clusterManagement",url:"/clusterManagement"}]}].filter(function(e){return e})}var a,r,o,i,l,u=n(23),d=n.n(u),c=n(14),f=n(15),p=n(17),h=n(16),m=(n(25),n(8)),g=n.n(m),y=n(21),v=(n(79),n(50)),_=n.n(v),b=n(0),w=n.n(b),M=n(33),k=n(43),S=n(126),E=n(92),L=n(47),x={key:"configurationManagementVirtual",children:[{key:"configurationManagement",url:"/configurationManagement"},{key:"historyRollback",url:"/historyRollback"},{key:"listeningToQuery",url:"/listeningToQuery"}]},T={key:"authorityControl",children:[{key:"userList",url:"/userManagement"},{key:"roleManagement",url:"/rolesManagement"},{key:"privilegeManagement",url:"/permissionsManagement"}]},C=_.a.SubMenu,D=_.a.Item,O=(a=Object(k.b)(function(e){return Object(y.a)(Object(y.a)({},e.locale),e.base)},{getState:E.b}),r=g.a.config,Object(M.g)(o=a(o=r((l=i=function(e){Object(p.a)(n,e);var t=Object(h.a)(n);function n(){return Object(c.a)(this,n),t.apply(this,arguments)}return Object(f.a)(n,[{key:"componentDidMount",value:function(){this.props.getState()}},{key:"goBack",value:function(){this.props.history.goBack()}},{key:"navTo",value:function(e){var t=this.props.location.search;this.props.history.push([e,t].join(""))}},{key:"isCurrentPath",value:function(e){return e===this.props.location.pathname?"current-path":void 0}},{key:"defaultOpenKeys",value:function(){for(var t=this,e=s(this.props.functionMode),n=0,a=e.length;nthis.state.pageSize&&Y.a.createElement("div",{style:{marginTop:10,textAlign:"right"}},Y.a.createElement(E.a,{current:this.state.pageNo,total:s,pageSize:this.state.pageSize,onChange:function(e){return t.setState({pageNo:e},function(){return t.querySubscriberList()})}}))))}}]),a}(Y.a.Component),r.displayName="SubscriberList",a=o))||a)||a;t.a=z},function(e,t,n){"use strict";n(51);var a,r,o,i=n(30),m=n.n(i),s=(n(61),n(45)),g=n.n(s),l=(n(377),n(98)),y=n.n(l),u=(n(32),n(20)),v=n.n(u),d=(n(37),n(10)),_=n.n(d),c=(n(49),n(26)),f=n.n(c),p=n(14),h=n(15),b=n(22),w=n(17),M=n(16),k=(n(25),n(8)),S=n.n(k),E=(n(385),n(99)),L=n.n(E),x=(n(60),n(13)),T=n.n(x),C=(n(67),n(38)),D=n.n(C),O=(n(41),n(9)),N=n.n(O),Y=n(0),P=n.n(Y),j=n(1),I=n(46),R=(n(700),N.a.Item),A=D.a.Row,H=D.a.Col,F=T.a.Column,z=L.a.Panel,W=(0,S.a.config)((o=r=function(e){Object(w.a)(a,e);var t=Object(M.a)(a);function a(e){var n;return Object(p.a)(this,a),(n=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 f.a(Object(b.a)(n)),n}return Object(h.a)(a,[{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,r=e.withInstances,o=["withInstances=".concat(void 0!==r&&r),"pageNo=".concat(t),"pageSize=".concat(n),"keyword=".concat(a)];Object(j.c)({url:"v1/core/cluster/nodes?".concat(o.join("&")),beforeSend:function(){return i.openLoading()},success:function(e){var t=0this.state.pageSize&&P.a.createElement("div",{style:{marginTop:10,textAlign:"right"}},P.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()})}}))))}}]),a}(P.a.Component),r.displayName="ClusterNodeList",a=o))||a;t.a=W},function(e,t,q){"use strict";q.r(t),function(e){q(51);var t,n=q(30),r=q.n(n),a=(q(25),q(8)),o=q.n(a),i=q(14),s=q(15),l=q(17),u=q(16),d=q(21),c=q(0),f=q.n(c),p=q(24),h=q.n(p),m=q(82),g=q(394),y=q(395),v=q(43),_=q(33),b=q(91),w=(q(439),q(413)),M=q(27),k=q(414),S=q(406),E=q(415),L=q(416),x=q(417),T=q(408),C=q(418),D=q(419),O=q(420),N=q(421),Y=q(405),P=q(409),j=q(407),I=q(422),R=q(423),A=q(410),H=q(411),F=q(412),z=q(403),W=q(404),V=q(95);q(703);e.hot,localStorage.getItem(M.f)||localStorage.setItem(M.f,"zh-CN"===navigator.language?"zh-CN":"en-US");var B=Object(m.c)(Object(d.a)(Object(d.a)({},W.a),{},{routing:g.routerReducer})),U=Object(m.e)(B,Object(m.d)(Object(m.a)(y.a),window[M.i]?window[M.i]():function(e){return e})),K=[{path:"/",exact:!0,render:function(){return f.a.createElement(_.a,{to:"/welcome"})}},{path:"/welcome",component:z.a},{path:"/namespace",component:S.a},{path:"/newconfig",component:E.a},{path:"/configsync",component:L.a},{path:"/configdetail",component:x.a},{path:"/configeditor",component:T.a},{path:"/historyDetail",component:C.a},{path:"/configRollback",component:D.a},{path:"/historyRollback",component:O.a},{path:"/listeningToQuery",component:N.a},{path:"/configurationManagement",component:Y.a},{path:"/serviceManagement",component:P.a},{path:"/serviceDetail",component:j.a},{path:"/subscriberList",component:I.a},{path:"/clusterManagement",component:R.a},{path:"/userManagement",component:A.a},{path:"/rolesManagement",component:F.a},{path:"/permissionsManagement",component:H.a}],G=Object(v.b)(function(e){return Object(d.a)({},e.locale)},{changeLanguage:V.a})(t=function(e){Object(l.a)(a,e);var n=Object(u.a)(a);function a(e){var t;return Object(i.a)(this,a),(t=n.call(this,e)).state={shownotice:"none",noticecontent:"",nacosLoading:{}},t}return Object(s.a)(a,[{key:"componentDidMount",value:function(){var e=localStorage.getItem(M.f);this.props.changeLanguage(e)}},{key:"render",value:function(){var e=this.props.locale;return f.a.createElement(r.a,Object.assign({className:"nacos-loading",shape:"flower",tip:"loading...",visible:!1,fullScreen:!0},this.state.nacosLoading),f.a.createElement(o.a,{locale:e},this.router))}},{key:"router",get:function(){return f.a.createElement(b.a,null,f.a.createElement(_.d,null,f.a.createElement(_.b,{path:"/login",component:k.a}),f.a.createElement(w.a,null,K.map(function(e){return f.a.createElement(_.b,Object.assign({key:e.path},e))}))))}}]),a}(f.a.Component))||t;h.a.render(f.a.createElement(v.a,{store:U},f.a.createElement(G,null)),document.getElementById("root"))}.call(this,q(170)(e))},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict"; /** @license React v16.13.1 * react.production.min.js * diff --git a/console/src/test/java/com/alibaba/nacos/console/controller/UserControllerTest.java b/console/src/test/java/com/alibaba/nacos/console/controller/UserControllerTest.java index 0588372b2..9b3fe8dd6 100644 --- a/console/src/test/java/com/alibaba/nacos/console/controller/UserControllerTest.java +++ b/console/src/test/java/com/alibaba/nacos/console/controller/UserControllerTest.java @@ -16,11 +16,11 @@ package com.alibaba.nacos.console.controller; +import com.alibaba.nacos.auth.common.AuthConfigs; +import com.alibaba.nacos.auth.common.AuthSystemTypes; +import com.alibaba.nacos.auth.exception.AccessException; import com.alibaba.nacos.console.security.nacos.NacosAuthManager; import com.alibaba.nacos.console.security.nacos.users.NacosUser; -import com.alibaba.nacos.core.auth.AccessException; -import com.alibaba.nacos.core.auth.AuthConfigs; -import com.alibaba.nacos.core.auth.AuthSystemTypes; import com.fasterxml.jackson.databind.JsonNode; import org.junit.Before; import org.junit.Test; diff --git a/core/pom.xml b/core/pom.xml index 59f26f0f3..51262723e 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -153,21 +153,6 @@ commons-collections - - io.jsonwebtoken - jjwt-api - - - io.jsonwebtoken - jjwt-impl - runtime - - - io.jsonwebtoken - jjwt-jackson - runtime - - org.reflections reflections diff --git a/core/src/main/java/com/alibaba/nacos/core/auth/AuthConfig.java b/core/src/main/java/com/alibaba/nacos/core/auth/AuthConfig.java new file mode 100644 index 000000000..daf85f7e6 --- /dev/null +++ b/core/src/main/java/com/alibaba/nacos/core/auth/AuthConfig.java @@ -0,0 +1,46 @@ +/* + * 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.core.auth; + +import org.springframework.boot.web.servlet.FilterRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * auth filter config. + * + * @author mai.jh + */ +@Configuration +public class AuthConfig { + + @Bean + public FilterRegistrationBean authFilterRegistration() { + FilterRegistrationBean registration = new FilterRegistrationBean<>(); + registration.setFilter(authFilter()); + registration.addUrlPatterns("/*"); + registration.setName("authFilter"); + registration.setOrder(6); + + return registration; + } + + @Bean + public AuthFilter authFilter() { + return new AuthFilter(); + } +} diff --git a/core/src/main/java/com/alibaba/nacos/core/auth/AuthFilter.java b/core/src/main/java/com/alibaba/nacos/core/auth/AuthFilter.java index 0cf41dcff..95fc13a19 100644 --- a/core/src/main/java/com/alibaba/nacos/core/auth/AuthFilter.java +++ b/core/src/main/java/com/alibaba/nacos/core/auth/AuthFilter.java @@ -16,6 +16,12 @@ package com.alibaba.nacos.core.auth; +import com.alibaba.nacos.auth.AuthManager; +import com.alibaba.nacos.auth.annotation.Secured; +import com.alibaba.nacos.auth.common.AuthConfigs; +import com.alibaba.nacos.auth.exception.AccessException; +import com.alibaba.nacos.auth.model.Permission; +import com.alibaba.nacos.auth.parser.ResourceParser; import com.alibaba.nacos.common.utils.ExceptionUtil; import com.alibaba.nacos.core.code.ControllerMethodsCache; import com.alibaba.nacos.core.utils.Constants; diff --git a/core/src/main/java/com/alibaba/nacos/core/exception/ErrorCode.java b/core/src/main/java/com/alibaba/nacos/core/exception/ErrorCode.java index c02ee3cd1..187b8f742 100644 --- a/core/src/main/java/com/alibaba/nacos/core/exception/ErrorCode.java +++ b/core/src/main/java/com/alibaba/nacos/core/exception/ErrorCode.java @@ -28,42 +28,47 @@ public enum ErrorCode { */ UnKnowError(40001), - // rocksdb error + // kv error /** - * rocksdb write error. + * KVStorage write error. */ - RocksDBWriteError(40100), + KVStorageWriteError(40100), /** - * rocksdb read error. + * KVStorage read error. */ - RocksDBReadError(40101), + KVStorageReadError(40101), /** - * rocksdb delete error. + * KVStorage delete error. */ - RocksDBDeleteError(40102), + KVStorageDeleteError(40102), /** - * rocksdb snapshot save error. + * KVStorage snapshot save error. */ - RocksDBSnapshotSaveError(40103), + KVStorageSnapshotSaveError(40103), /** - * rocksdb snapshot load error. + * KVStorage snapshot load error. */ - RocksDBSnapshotLoadError(40104), + KVStorageSnapshotLoadError(40104), /** - * rocksdb reset error. + * KVStorage reset error. */ - RocksDBResetError(40105), + KVStorageResetError(40105), /** - * rocksdb create error. + * KVStorage create error. */ - RocksDBCreateError(40106), + KVStorageCreateError(40106), + + /** + * KVStorage write error. + */ + KVStorageBatchWriteError(40107), // disk error @@ -72,6 +77,11 @@ public enum ErrorCode { */ IOMakeDirError(40201), + /** + * copy directory has error + */ + IOCopyDirError(40202), + // consistency protocol error /** diff --git a/core/src/main/java/com/alibaba/nacos/core/exception/RocksStorageException.java b/core/src/main/java/com/alibaba/nacos/core/exception/KVStorageException.java similarity index 69% rename from core/src/main/java/com/alibaba/nacos/core/exception/RocksStorageException.java rename to core/src/main/java/com/alibaba/nacos/core/exception/KVStorageException.java index 0530e50c0..3956e7b2e 100644 --- a/core/src/main/java/com/alibaba/nacos/core/exception/RocksStorageException.java +++ b/core/src/main/java/com/alibaba/nacos/core/exception/KVStorageException.java @@ -24,21 +24,33 @@ import com.alibaba.nacos.api.exception.NacosException; * * @author liaochuntao */ -public class RocksStorageException extends NacosException { +public class KVStorageException extends NacosException { - public RocksStorageException() { + public KVStorageException() { super(); } - public RocksStorageException(int errCode, String errMsg) { + public KVStorageException(ErrorCode code, String errMsg) { + super(code.getCode(), errMsg); + } + + public KVStorageException(ErrorCode errCode, Throwable throwable) { + super(errCode.getCode(), throwable); + } + + public KVStorageException(ErrorCode errCode, String errMsg, Throwable throwable) { + super(errCode.getCode(), errMsg, throwable); + } + + public KVStorageException(int errCode, String errMsg) { super(errCode, errMsg); } - public RocksStorageException(int errCode, Throwable throwable) { + public KVStorageException(int errCode, Throwable throwable) { super(errCode, throwable); } - public RocksStorageException(int errCode, String errMsg, Throwable throwable) { + public KVStorageException(int errCode, String errMsg, Throwable throwable) { super(errCode, errMsg, throwable); } diff --git a/core/src/main/java/com/alibaba/nacos/core/storage/StorageFactory.java b/core/src/main/java/com/alibaba/nacos/core/storage/StorageFactory.java new file mode 100644 index 000000000..bb9a373ed --- /dev/null +++ b/core/src/main/java/com/alibaba/nacos/core/storage/StorageFactory.java @@ -0,0 +1,43 @@ +/* + * 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.core.storage; + +import com.alibaba.nacos.core.storage.kv.FileKVStorage; +import com.alibaba.nacos.core.storage.kv.KvStorage; +import com.alibaba.nacos.core.storage.kv.MemoryKVStorage; +import com.alibaba.nacos.core.storage.kv.RocksStorage; + +/** + * @author liaochuntao + */ +public final class StorageFactory { + + public static KvStorage createKVStorage(KvStorage.KVType type, final String label, final String baseDir) { + switch (type) { + case File: + return new FileKVStorage(baseDir); + case Memory: + return new MemoryKVStorage(); + case RocksDB: + return RocksStorage.createDefault(label, baseDir); + default: + throw new IllegalArgumentException("this kv type : [" + type.name() + "] not support"); + } + } + +} diff --git a/core/src/main/java/com/alibaba/nacos/core/storage/kv/FileKVStorage.java b/core/src/main/java/com/alibaba/nacos/core/storage/kv/FileKVStorage.java new file mode 100644 index 000000000..00722c4c9 --- /dev/null +++ b/core/src/main/java/com/alibaba/nacos/core/storage/kv/FileKVStorage.java @@ -0,0 +1,175 @@ +/* + * 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.core.storage.kv; + +import com.alibaba.nacos.core.exception.ErrorCode; +import com.alibaba.nacos.core.exception.KVStorageException; +import com.alibaba.nacos.core.utils.DiskUtils; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Paths; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.locks.ReentrantReadWriteLock; + +/** + * File based KV storage + * + * @author liaochuntao + */ +public class FileKVStorage implements KvStorage { + + private final String baseDir; + + private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(); + private final ReentrantReadWriteLock.ReadLock readLock = lock.readLock(); + private final ReentrantReadWriteLock.WriteLock writeLock = lock.writeLock(); + + public FileKVStorage(String baseDir) { + this.baseDir = baseDir; + } + + @Override + public byte[] get(byte[] key) throws KVStorageException { + readLock.lock(); + try { + final String fileName = new String(key); + File file = Paths.get(baseDir, fileName).toFile(); + if (file.exists()) { + return DiskUtils.readFileBytes(file); + } + return null; + } finally { + readLock.unlock(); + } + } + + @Override + public Map batchGet(List keys) throws KVStorageException { + readLock.lock(); + try { + Map result = new HashMap<>(keys.size()); + for (byte[] key : keys) { + byte[] val = get(key); + if (val != null) { + result.put(key, val); + } + } + return result; + } finally { + readLock.unlock(); + } + } + + @Override + public void put(byte[] key, byte[] value) throws KVStorageException { + readLock.lock(); + try { + final String fileName = new String(key); + File file = Paths.get(baseDir, fileName).toFile(); + try { + DiskUtils.touch(file); + DiskUtils.writeFile(file, value, false); + } catch (IOException e) { + throw new KVStorageException(ErrorCode.KVStorageWriteError, e); + } + } finally { + readLock.unlock(); + } + } + + @Override + public void batchPut(List keys, List values) throws KVStorageException { + readLock.lock(); + try { + if (keys.size() != values.size()) { + throw new KVStorageException(ErrorCode.KVStorageBatchWriteError, + "key's size must be equal to value's size"); + } + int size = keys.size(); + for (int i = 0; i < size; i++) { + put(keys.get(i), values.get(i)); + } + } finally { + readLock.unlock(); + } + } + + @Override + public void delete(byte[] key) throws KVStorageException { + readLock.lock(); + try { + final String fileName = new String(key); + File file = Paths.get(baseDir, fileName).toFile(); + if (file.exists()) { + file.delete(); + } + } finally { + readLock.unlock(); + } + } + + @Override + public void batchDelete(List keys) throws KVStorageException { + readLock.lock(); + try { + for (byte[] key : keys) { + delete(key); + } + } finally { + readLock.unlock(); + } + } + + @Override + public void doSnapshot(String backupPath) throws KVStorageException { + writeLock.lock(); + try { + File srcDir = Paths.get(baseDir).toFile(); + File descDir = Paths.get(backupPath).toFile(); + DiskUtils.copyDirectory(srcDir, descDir); + } catch (IOException e) { + throw new KVStorageException(ErrorCode.IOCopyDirError, e); + } finally { + writeLock.unlock(); + } + } + + @Override + public void snapshotLoad(String path) throws KVStorageException { + writeLock.lock(); + try { + // First clean up the local file information, before the file copy + DiskUtils.deleteDirThenMkdir(baseDir); + File srcDir = Paths.get(path).toFile(); + File descDir = Paths.get(baseDir).toFile(); + DiskUtils.copyDirectory(srcDir, descDir); + } catch (IOException e) { + throw new KVStorageException(ErrorCode.IOCopyDirError, e); + } finally { + writeLock.unlock(); + } + } + + @Override + public void shutdown() { + + } +} diff --git a/core/src/main/java/com/alibaba/nacos/core/storage/kv/KvStorage.java b/core/src/main/java/com/alibaba/nacos/core/storage/kv/KvStorage.java new file mode 100644 index 000000000..494d861a4 --- /dev/null +++ b/core/src/main/java/com/alibaba/nacos/core/storage/kv/KvStorage.java @@ -0,0 +1,114 @@ +/* + * 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.core.storage.kv; + +import com.alibaba.nacos.core.exception.KVStorageException; + +import java.util.List; +import java.util.Map; + +/** + * Universal KV storage interface + * + * @author liaochuntao + */ +public interface KvStorage { + + enum KVType { + File, + + Memory, + + RocksDB, + } + + + /** + * get data by key + * + * @param key byte[] + * @return byte[] + * @throws KVStorageException KVStorageException + */ + byte[] get(byte[] key) throws KVStorageException; + + /** + * batch get by List byte[]. + * + * @param keys List byte[] + * @return Map byte[], byte[] + * @throws KVStorageException RocksStorageException + */ + Map batchGet(List keys) throws KVStorageException; + + /** + * write data. + * + * @param key byte[] + * @param value byte[] + * @throws KVStorageException RocksStorageException + */ + void put(byte[] key, byte[] value) throws KVStorageException; + + /** + * batch write. + * + * @param key List byte[] + * @param values List byte[] + * @throws KVStorageException RocksStorageException + */ + void batchPut(List key, List values) throws KVStorageException; + + /** + * delete with key. + * + * @param key byte[] + * @throws KVStorageException RocksStorageException + */ + void delete(byte[] key) throws KVStorageException; + + /** + * batch delete with keys. + * + * @param key List byte[] + * @throws KVStorageException RocksStorageException + */ + void batchDelete(List key) throws KVStorageException; + + /** + * do snapshot. + * + * @param backupPath snapshot file save path + * @throws KVStorageException KVStorageException + */ + void doSnapshot(final String backupPath) throws KVStorageException; + + /** + * load snapshot. + * + * @param path The path to the snapshot file + * @throws KVStorageException KVStorageException + */ + void snapshotLoad(String path) throws KVStorageException; + + /** + * shutdown. + */ + void shutdown(); + +} diff --git a/core/src/main/java/com/alibaba/nacos/core/storage/kv/MemoryKVStorage.java b/core/src/main/java/com/alibaba/nacos/core/storage/kv/MemoryKVStorage.java new file mode 100644 index 000000000..3fe63c510 --- /dev/null +++ b/core/src/main/java/com/alibaba/nacos/core/storage/kv/MemoryKVStorage.java @@ -0,0 +1,129 @@ +/* + * 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.core.storage.kv; + +import com.alibaba.nacos.core.exception.ErrorCode; +import com.alibaba.nacos.core.exception.KVStorageException; +import com.alipay.sofa.jraft.util.BytesUtil; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentSkipListMap; + +/** + * @author liaochuntao + */ +public class MemoryKVStorage implements KvStorage { + + private final Map storage = new ConcurrentSkipListMap(); + + @Override + public byte[] get(byte[] key) throws KVStorageException { + return storage.get(new Key(key)); + } + + @Override + public Map batchGet(List keys) throws KVStorageException { + Map result = new HashMap<>(keys.size()); + for (byte[] key : keys) { + byte[] val = storage.get(new Key(key)); + if (val != null) { + result.put(key, val); + } + } + return result; + } + + @Override + public void put(byte[] key, byte[] value) throws KVStorageException { + storage.put(new Key(key), value); + } + + @Override + public void batchPut(List keys, List values) throws KVStorageException { + if (keys.size() != values.size()) { + throw new KVStorageException(ErrorCode.KVStorageBatchWriteError.getCode(), + "key's size must be equal to value's size"); + } + int size = keys.size(); + for (int i = 0; i < size; i ++) { + storage.put(new Key(keys.get(i)), values.get(i)); + } + } + + @Override + public void delete(byte[] key) throws KVStorageException { + storage.remove(new Key(key)); + } + + @Override + public void batchDelete(List keys) throws KVStorageException { + for (byte[] key : keys) { + storage.remove(new Key(key)); + } + } + + @Override + public void doSnapshot(String backupPath) throws KVStorageException { + throw new UnsupportedOperationException(); + } + + @Override + public void snapshotLoad(String path) throws KVStorageException { + throw new UnsupportedOperationException(); + } + + @Override + public void shutdown() { + storage.clear(); + } + + private static class Key implements Comparable { + + private final byte[] origin; + + private Key(byte[] origin) { + this.origin = origin; + } + + @Override + public int compareTo(byte[] o) { + return BytesUtil.compare(origin, o); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Key key = (Key) o; + return Arrays.equals(origin, key.origin); + } + + @Override + public int hashCode() { + return Arrays.hashCode(origin); + } + } + +} diff --git a/core/src/main/java/com/alibaba/nacos/core/storage/RocksBackupInfo.java b/core/src/main/java/com/alibaba/nacos/core/storage/kv/RocksBackupInfo.java similarity index 97% rename from core/src/main/java/com/alibaba/nacos/core/storage/RocksBackupInfo.java rename to core/src/main/java/com/alibaba/nacos/core/storage/kv/RocksBackupInfo.java index cd75e4e31..6c710e7c0 100644 --- a/core/src/main/java/com/alibaba/nacos/core/storage/RocksBackupInfo.java +++ b/core/src/main/java/com/alibaba/nacos/core/storage/kv/RocksBackupInfo.java @@ -15,7 +15,7 @@ * */ -package com.alibaba.nacos.core.storage; +package com.alibaba.nacos.core.storage.kv; /** * RocksDB backup info. diff --git a/core/src/main/java/com/alibaba/nacos/core/storage/RocksDBUtils.java b/core/src/main/java/com/alibaba/nacos/core/storage/kv/RocksDBUtils.java similarity index 99% rename from core/src/main/java/com/alibaba/nacos/core/storage/RocksDBUtils.java rename to core/src/main/java/com/alibaba/nacos/core/storage/kv/RocksDBUtils.java index 398ec5b77..a8a472250 100644 --- a/core/src/main/java/com/alibaba/nacos/core/storage/RocksDBUtils.java +++ b/core/src/main/java/com/alibaba/nacos/core/storage/kv/RocksDBUtils.java @@ -15,7 +15,7 @@ * */ -package com.alibaba.nacos.core.storage; +package com.alibaba.nacos.core.storage.kv; import com.alipay.sofa.jraft.util.Platform; import com.alipay.sofa.jraft.util.Utils; diff --git a/core/src/main/java/com/alibaba/nacos/core/storage/RocksStorage.java b/core/src/main/java/com/alibaba/nacos/core/storage/kv/RocksStorage.java similarity index 71% rename from core/src/main/java/com/alibaba/nacos/core/storage/RocksStorage.java rename to core/src/main/java/com/alibaba/nacos/core/storage/kv/RocksStorage.java index 78a9b5150..e998b4e9a 100644 --- a/core/src/main/java/com/alibaba/nacos/core/storage/RocksStorage.java +++ b/core/src/main/java/com/alibaba/nacos/core/storage/kv/RocksStorage.java @@ -15,13 +15,13 @@ * */ -package com.alibaba.nacos.core.storage; +package com.alibaba.nacos.core.storage.kv; import com.alibaba.nacos.api.exception.runtime.NacosRuntimeException; import com.alibaba.nacos.common.utils.JacksonUtils; import com.alibaba.nacos.common.utils.StringUtils; import com.alibaba.nacos.core.exception.ErrorCode; -import com.alibaba.nacos.core.exception.RocksStorageException; +import com.alibaba.nacos.core.exception.KVStorageException; import com.alibaba.nacos.core.utils.DiskUtils; import org.rocksdb.BackupEngine; import org.rocksdb.BackupableDBOptions; @@ -53,7 +53,7 @@ import java.util.stream.Collectors; * * @author liaochuntao */ -public final class RocksStorage { +public class RocksStorage implements KvStorage { private String group; @@ -81,11 +81,11 @@ public final class RocksStorage { /** * create rocksdb storage with default operation. * - * @param group group + * @param group group * @param baseDir base dir * @return {@link RocksStorage} */ - public static RocksStorage createDefault(final String group, String baseDir) { + public static RocksStorage createDefault(final String group, final String baseDir) { return createCustomer(group, baseDir, new WriteOptions().setSync(true), new ReadOptions().setTotalOrderSeek(true)); } @@ -93,17 +93,15 @@ public final class RocksStorage { /** * create rocksdb storage and set customer operation. * - * @param group group - * @param baseDir base dir + * @param group group + * @param baseDir base dir * @param writeOptions {@link WriteOptions} - * @param readOptions {@link ReadOptions} + * @param readOptions {@link ReadOptions} * @return {@link RocksStorage} */ public static RocksStorage createCustomer(final String group, String baseDir, WriteOptions writeOptions, ReadOptions readOptions) { - RocksStorage storage = new RocksStorage(); - try { DiskUtils.forceMkdir(baseDir); } catch (IOException e) { @@ -116,26 +114,26 @@ public final class RocksStorage { /** * destroy old rocksdb and open new one. * - * @throws RocksStorageException RocksStorageException + * @throws KVStorageException RocksStorageException */ - public void destroyAndOpenNew() throws RocksStorageException { + public void destroyAndOpenNew() throws KVStorageException { try (final Options options = new Options()) { RocksDB.destroyDB(dbPath, options); createRocksDB(dbPath, group, writeOptions, readOptions, this); } catch (RocksDBException ex) { Status status = ex.getStatus(); - throw createRocksStorageException(ErrorCode.RocksDBResetError, status); + throw createRocksStorageException(ErrorCode.KVStorageResetError, status); } } /** * create rocksdb. * - * @param baseDir base dir - * @param group group + * @param baseDir base dir + * @param group group * @param writeOptions {@link WriteOptions} - * @param readOptions {@link ReadOptions} - * @param storage {@link RocksStorage} + * @param readOptions {@link ReadOptions} + * @param storage {@link RocksStorage} */ private static void createRocksDB(final String baseDir, final String group, WriteOptions writeOptions, ReadOptions readOptions, final RocksStorage storage) { @@ -156,34 +154,22 @@ public final class RocksStorage { storage.db = RocksDB.open(options, baseDir, columnFamilyDescriptors, columnFamilyHandles); storage.defaultHandle = columnFamilyHandles.get(0); } catch (RocksDBException e) { - throw new NacosRuntimeException(ErrorCode.RocksDBCreateError.getCode(), e); + throw new NacosRuntimeException(ErrorCode.KVStorageCreateError.getCode(), e); } } - /** - * write data. - * - * @param key byte[] - * @param value byte[] - * @throws RocksStorageException RocksStorageException - */ - public void write(byte[] key, byte[] value) throws RocksStorageException { + @Override + public void put(byte[] key, byte[] value) throws KVStorageException { try { this.db.put(defaultHandle, writeOptions, key, value); } catch (RocksDBException e) { Status status = e.getStatus(); - throw createRocksStorageException(ErrorCode.RocksDBWriteError, status); + throw createRocksStorageException(ErrorCode.KVStorageWriteError, status); } } - /** - * batch write. - * - * @param key List byte[] - * @param values List byte[] - * @throws RocksStorageException RocksStorageException - */ - public void batchWrite(List key, List values) throws RocksStorageException { + @Override + public void batchPut(List key, List values) throws KVStorageException { if (key.size() != values.size()) { throw new IllegalArgumentException("key size and values size must be equals!"); } @@ -194,81 +180,72 @@ public final class RocksStorage { db.write(writeOptions, batch); } catch (RocksDBException e) { Status status = e.getStatus(); - throw createRocksStorageException(ErrorCode.RocksDBWriteError, status); + throw createRocksStorageException(ErrorCode.KVStorageWriteError, status); } } - /** - * get data by byte[]. - * - * @param key byte[] - * @return result byte[] - * @throws RocksStorageException RocksStorageException - */ - public byte[] get(byte[] key) throws RocksStorageException { + @Override + public byte[] get(byte[] key) throws KVStorageException { try { return db.get(defaultHandle, readOptions, key); } catch (RocksDBException e) { Status status = e.getStatus(); - throw createRocksStorageException(ErrorCode.RocksDBReadError, status); + throw createRocksStorageException(ErrorCode.KVStorageReadError, status); } } - /** - * batch get by List byte[]. - * - * @param key List byte[] - * @return Map byte[], byte[] - * @throws RocksStorageException RocksStorageException - */ - public Map batchGet(List key) throws RocksStorageException { + @Override + public Map batchGet(List keys) throws KVStorageException { try { - return db.multiGet(readOptions, key); + return db.multiGet(readOptions, keys); } catch (RocksDBException e) { Status status = e.getStatus(); - throw createRocksStorageException(ErrorCode.RocksDBReadError, status); + throw createRocksStorageException(ErrorCode.KVStorageReadError, status); } } - /** - * delete with key. - * - * @param key byte[] - * @throws RocksStorageException RocksStorageException - */ - public void delete(byte[] key) throws RocksStorageException { + @Override + public void delete(byte[] key) throws KVStorageException { try { db.delete(defaultHandle, writeOptions, key); } catch (RocksDBException e) { Status status = e.getStatus(); - throw createRocksStorageException(ErrorCode.RocksDBDeleteError, status); + throw createRocksStorageException(ErrorCode.KVStorageDeleteError, status); } } - /** - * batch delete with keys. - * - * @param key List byte[] - * @throws RocksStorageException RocksStorageException - */ - public void batchDelete(List key) throws RocksStorageException { + @Override + public void batchDelete(List key) throws KVStorageException { try { for (byte[] k : key) { db.delete(defaultHandle, writeOptions, k); } } catch (RocksDBException e) { Status status = e.getStatus(); - throw createRocksStorageException(ErrorCode.RocksDBDeleteError, status); + throw createRocksStorageException(ErrorCode.KVStorageDeleteError, status); } } + @Override + public void shutdown() { + this.defaultHandle.close(); + this.db.close(); + for (final ColumnFamilyOptions opt : this.cfOptions) { + opt.close(); + } + this.options.close(); + this.writeOptions.close(); + this.readOptions.close(); + } + /** * do snapshot save operation. * * @param backupPath backup path - * @throws RocksStorageException RocksStorageException + * @throws KVStorageException RocksStorageException */ - public void snapshotSave(final String backupPath) throws RocksStorageException { + @Override + public void doSnapshot(final String backupPath) throws KVStorageException { final String path = Paths.get(backupPath, group).toString(); Throwable ex = DiskUtils.forceMkdir(path, (aVoid, ioe) -> { BackupableDBOptions backupOpt = new BackupableDBOptions(path).setSync(true).setShareTableFiles(false); @@ -284,13 +261,13 @@ public final class RocksStorage { return null; } catch (RocksDBException e) { Status status = e.getStatus(); - return createRocksStorageException(ErrorCode.RocksDBSnapshotSaveError, status); + return createRocksStorageException(ErrorCode.KVStorageSnapshotSaveError, status); } catch (Throwable throwable) { return throwable; } }); if (ex != null) { - throw new RocksStorageException(ErrorCode.UnKnowError.getCode(), ex); + throw new KVStorageException(ErrorCode.UnKnowError, ex); } } @@ -298,9 +275,10 @@ public final class RocksStorage { * do snapshot load operation. * * @param backupPath backup path - * @throws RocksStorageException RocksStorageException + * @throws KVStorageException RocksStorageException */ - public void snapshotLoad(final String backupPath) throws RocksStorageException { + @Override + public void snapshotLoad(final String backupPath) throws KVStorageException { try { final String path = Paths.get(backupPath, group).toString(); final File file = Paths.get(path, "meta_snapshot").toFile(); @@ -316,30 +294,16 @@ public final class RocksStorage { backupEngine.restoreDbFromBackup(info.getBackupId(), dbPath, dbOptions.walDir(), options); } catch (RocksDBException ex) { Status status = ex.getStatus(); - throw createRocksStorageException(ErrorCode.RocksDBSnapshotLoadError, status); + throw createRocksStorageException(ErrorCode.KVStorageSnapshotLoadError, status); } catch (Throwable ex) { - throw new RocksStorageException(ErrorCode.UnKnowError.getCode(), ex); + throw new KVStorageException(ErrorCode.UnKnowError, ex); } } - /** - * shutdown. - */ - public void shutdown() { - this.defaultHandle.close(); - this.db.close(); - for (final ColumnFamilyOptions opt : this.cfOptions) { - opt.close(); - } - this.options.close(); - this.writeOptions.close(); - this.readOptions.close(); - } - - private static RocksStorageException createRocksStorageException(ErrorCode code, Status status) { - RocksStorageException exception = new RocksStorageException(); + private static KVStorageException createRocksStorageException(ErrorCode code, Status status) { + KVStorageException exception = new KVStorageException(); exception.setErrCode(code.getCode()); - exception.setErrMsg(String.format("RocksDB error msg : code=%s, subCode=%s, state=%s", status.getCode(), + exception.setErrMsg(String.format("RocksDB error msg : code=%s, subCode=%s, state=%s", status, status.getSubCode(), status.getState())); return exception; } diff --git a/core/src/main/java/com/alibaba/nacos/core/utils/DiskUtils.java b/core/src/main/java/com/alibaba/nacos/core/utils/DiskUtils.java index 1c129ae45..37aaa0507 100644 --- a/core/src/main/java/com/alibaba/nacos/core/utils/DiskUtils.java +++ b/core/src/main/java/com/alibaba/nacos/core/utils/DiskUtils.java @@ -256,7 +256,7 @@ public final class DiskUtils { * @param append write append mode * @return write success */ - public static boolean writeFile(File file, byte[] content, boolean append) { + public static boolean writeFile(File file, byte[] content, boolean append) throws IOException { try (FileChannel fileChannel = new FileOutputStream(file, append).getChannel()) { ByteBuffer buffer = ByteBuffer.wrap(content); fileChannel.write(buffer); @@ -269,6 +269,8 @@ public final class DiskUtils { LOGGER.warn("磁盘满,自杀退出"); System.exit(0); } + } else { + throw ioe; } } return false; diff --git a/core/src/main/java/com/alibaba/nacos/core/utils/InetUtils.java b/core/src/main/java/com/alibaba/nacos/core/utils/InetUtils.java index 06574caac..e9241e825 100644 --- a/core/src/main/java/com/alibaba/nacos/core/utils/InetUtils.java +++ b/core/src/main/java/com/alibaba/nacos/core/utils/InetUtils.java @@ -132,7 +132,6 @@ public class InetUtils { }; GlobalExecutor.runWithoutThread(ipAutoRefresh); - GlobalExecutor.scheduleByCommon(ipAutoRefresh, delayMs); } public static String getSelfIp() { diff --git a/core/src/test/java/com/alibaba/nacos/core/storage/RocksStorageTest.java b/core/src/test/java/com/alibaba/nacos/core/storage/RocksStorageTest.java index f2f665120..7c95a303c 100644 --- a/core/src/test/java/com/alibaba/nacos/core/storage/RocksStorageTest.java +++ b/core/src/test/java/com/alibaba/nacos/core/storage/RocksStorageTest.java @@ -18,6 +18,7 @@ package com.alibaba.nacos.core.storage; import com.alibaba.nacos.common.utils.ThreadUtils; +import com.alibaba.nacos.core.storage.kv.RocksStorage; import com.alibaba.nacos.core.utils.ApplicationUtils; import com.alibaba.nacos.core.utils.DiskUtils; import org.junit.Assert; @@ -45,14 +46,14 @@ public class RocksStorageTest { @Test public void testCreateRocksStorage() throws Throwable { RocksStorage storage = RocksStorage.createDefault("test", DIR); - storage.write("liaochuntao".getBytes(), "liaochuntao".getBytes()); + storage.put("liaochuntao".getBytes(), "liaochuntao".getBytes()); } @Test public void testRocksStorageSnapshotSave() throws Throwable { try { RocksStorage storage = RocksStorage.createDefault("test", DIR); - storage.write("liaochuntao".getBytes(), "liaochuntao".getBytes()); + storage.put("liaochuntao".getBytes(), "liaochuntao".getBytes()); storage.snapshotSave(Paths.get(DIR, "snapshot").toString()); } catch (Throwable ex) { Assert.fail(ex.getMessage()); @@ -62,7 +63,7 @@ public class RocksStorageTest { @Test public void testRocksStorageSnapshotLoad() throws Throwable { RocksStorage storage = RocksStorage.createDefault("test", DIR); - storage.write("liaochuntao".getBytes(), "liaochuntao".getBytes()); + storage.put("liaochuntao".getBytes(), "liaochuntao".getBytes()); storage.snapshotSave(Paths.get(DIR, "snapshot").toString()); storage.shutdown(); ThreadUtils.sleep(5_000L); diff --git a/naming/src/main/java/com/alibaba/nacos/naming/consistency/persistent/impl/NamingSnapshotOperation.java b/naming/src/main/java/com/alibaba/nacos/naming/consistency/persistent/impl/NamingSnapshotOperation.java index cac5f1bd0..9decc767b 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/consistency/persistent/impl/NamingSnapshotOperation.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/consistency/persistent/impl/NamingSnapshotOperation.java @@ -22,7 +22,7 @@ import com.alibaba.nacos.consistency.snapshot.Reader; import com.alibaba.nacos.consistency.snapshot.SnapshotOperation; import com.alibaba.nacos.consistency.snapshot.Writer; import com.alibaba.nacos.core.distributed.raft.utils.RaftExecutor; -import com.alibaba.nacos.core.storage.RocksStorage; +import com.alibaba.nacos.core.storage.kv.KvStorage; import com.alibaba.nacos.core.utils.DiskUtils; import com.alibaba.nacos.core.utils.TimerContext; import com.alibaba.nacos.naming.misc.Loggers; @@ -47,11 +47,11 @@ public class NamingSnapshotOperation implements SnapshotOperation { private final String checkSumKey = "checkSum"; - private final RocksStorage storage; + private final KvStorage storage; private final ReentrantReadWriteLock.WriteLock writeLock; - public NamingSnapshotOperation(RocksStorage storage, ReentrantReadWriteLock lock) { + public NamingSnapshotOperation(KvStorage storage, ReentrantReadWriteLock lock) { this.storage = storage; this.writeLock = lock.writeLock(); } @@ -69,7 +69,7 @@ public class NamingSnapshotOperation implements SnapshotOperation { DiskUtils.deleteDirectory(parentPath); DiskUtils.forceMkdir(parentPath); - storage.snapshotSave(parentPath); + storage.doSnapshot(parentPath); final String outputFile = Paths.get(writePath, snapshotArchive).toString(); final Checksum checksum = new CRC64(); DiskUtils.compress(writePath, snapshotDir, outputFile, checksum); diff --git a/naming/src/main/java/com/alibaba/nacos/naming/consistency/persistent/impl/PersistentServiceProcessor.java b/naming/src/main/java/com/alibaba/nacos/naming/consistency/persistent/impl/PersistentServiceProcessor.java index 6112735a5..1ec864b67 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/consistency/persistent/impl/PersistentServiceProcessor.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/consistency/persistent/impl/PersistentServiceProcessor.java @@ -35,14 +35,15 @@ import com.alibaba.nacos.consistency.entity.Response; import com.alibaba.nacos.consistency.snapshot.SnapshotOperation; import com.alibaba.nacos.core.distributed.raft.RaftConfig; import com.alibaba.nacos.core.exception.ErrorCode; -import com.alibaba.nacos.core.exception.RocksStorageException; -import com.alibaba.nacos.core.storage.RocksStorage; +import com.alibaba.nacos.core.exception.KVStorageException; +import com.alibaba.nacos.core.storage.StorageFactory; +import com.alibaba.nacos.core.storage.kv.KvStorage; import com.alibaba.nacos.naming.consistency.Datum; import com.alibaba.nacos.naming.consistency.RecordListener; +import com.alibaba.nacos.naming.consistency.ValueChangeEvent; import com.alibaba.nacos.naming.consistency.persistent.ClusterVersionJudgement; import com.alibaba.nacos.naming.consistency.persistent.PersistentConsistencyService; import com.alibaba.nacos.naming.consistency.persistent.PersistentNotifier; -import com.alibaba.nacos.naming.consistency.ValueChangeEvent; import com.alibaba.nacos.naming.consistency.persistent.raft.RaftStore; import com.alibaba.nacos.naming.misc.GlobalExecutor; import com.alibaba.nacos.naming.misc.Loggers; @@ -96,7 +97,7 @@ public class PersistentServiceProcessor extends LogProcessor4CP implements Persi private final CPProtocol protocol; - private final RocksStorage rocksStorage; + private final KvStorage rocksStorage; private final RaftStore oldStore; @@ -128,13 +129,14 @@ public class PersistentServiceProcessor extends LogProcessor4CP implements Persi this.protocol = protocol; this.oldStore = oldStore; this.versionJudgement = versionJudgement; - this.rocksStorage = RocksStorage - .createDefault("naming-persistent", Paths.get(UtilsAndCommons.DATA_BASE_DIR, "persistent").toString()); + this.rocksStorage = StorageFactory + .createKVStorage( + KvStorage.KVType.File, "naming-persistent", Paths.get(UtilsAndCommons.DATA_BASE_DIR, "persistent").toString()); this.notifier = new PersistentNotifier(key -> { try { byte[] data = rocksStorage.get(ByteUtils.toBytes(key)); return serializer.deserialize(data); - } catch (RocksStorageException ex) { + } catch (KVStorageException ex) { throw new NacosRuntimeException(ex.getErrCode(), ex.getErrMsg()); } }); @@ -169,7 +171,7 @@ public class PersistentServiceProcessor extends LogProcessor4CP implements Persi final Map result = rocksStorage.batchGet(keys); return Response.newBuilder().setSuccess(true).setData(ByteString.copyFrom(serializer.serialize(result))) .build(); - } catch (RocksStorageException e) { + } catch (KVStorageException e) { return Response.newBuilder().setSuccess(false).setErrMsg(e.getErrMsg()).build(); } finally { lock.unlock(); @@ -186,7 +188,7 @@ public class PersistentServiceProcessor extends LogProcessor4CP implements Persi try { switch (op) { case Write: - rocksStorage.batchWrite(request.getKeys(), request.getValues()); + rocksStorage.batchPut(request.getKeys(), request.getValues()); break; case Delete: rocksStorage.batchDelete(request.getKeys()); @@ -195,7 +197,7 @@ public class PersistentServiceProcessor extends LogProcessor4CP implements Persi return Response.newBuilder().setSuccess(false).setErrMsg("unsupport operation : " + op).build(); } return Response.newBuilder().setSuccess(true).build(); - } catch (RocksStorageException e) { + } catch (KVStorageException e) { return Response.newBuilder().setSuccess(false).setErrMsg(e.getErrMsg()).build(); } finally { lock.unlock(); 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 966b0c00f..ce0992e8f 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 @@ -21,9 +21,9 @@ import com.alibaba.nacos.api.exception.NacosException; import com.alibaba.nacos.api.naming.CommonParams; import com.alibaba.nacos.api.naming.pojo.Cluster; import com.alibaba.nacos.api.naming.utils.NamingUtils; +import com.alibaba.nacos.auth.annotation.Secured; +import com.alibaba.nacos.auth.common.ActionTypes; import com.alibaba.nacos.common.utils.JacksonUtils; -import com.alibaba.nacos.core.auth.ActionTypes; -import com.alibaba.nacos.core.auth.Secured; import com.alibaba.nacos.core.utils.WebUtils; import com.alibaba.nacos.naming.core.Instance; import com.alibaba.nacos.naming.core.Service; 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 d3d75fe0b..3d1e94890 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 @@ -21,8 +21,8 @@ import com.alibaba.nacos.api.exception.NacosException; import com.alibaba.nacos.api.naming.CommonParams; import com.alibaba.nacos.api.naming.pojo.healthcheck.AbstractHealthChecker; import com.alibaba.nacos.api.naming.pojo.healthcheck.HealthCheckerFactory; -import com.alibaba.nacos.core.auth.ActionTypes; -import com.alibaba.nacos.core.auth.Secured; +import com.alibaba.nacos.auth.annotation.Secured; +import com.alibaba.nacos.auth.common.ActionTypes; import com.alibaba.nacos.core.utils.WebUtils; import com.alibaba.nacos.naming.core.Cluster; import com.alibaba.nacos.naming.core.Service; diff --git a/naming/src/main/java/com/alibaba/nacos/naming/controllers/HealthController.java b/naming/src/main/java/com/alibaba/nacos/naming/controllers/HealthController.java index 428e1d61a..85957f5f4 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/controllers/HealthController.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/controllers/HealthController.java @@ -19,9 +19,9 @@ package com.alibaba.nacos.naming.controllers; import com.alibaba.nacos.api.common.Constants; import com.alibaba.nacos.api.naming.CommonParams; import com.alibaba.nacos.api.naming.pojo.healthcheck.AbstractHealthChecker; +import com.alibaba.nacos.auth.annotation.Secured; +import com.alibaba.nacos.auth.common.ActionTypes; import com.alibaba.nacos.common.utils.JacksonUtils; -import com.alibaba.nacos.core.auth.ActionTypes; -import com.alibaba.nacos.core.auth.Secured; import com.alibaba.nacos.core.utils.ApplicationUtils; import com.alibaba.nacos.core.utils.WebUtils; import com.alibaba.nacos.naming.core.Instance; 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 403ff6ec9..6e43835d1 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 @@ -22,9 +22,9 @@ import com.alibaba.nacos.api.naming.CommonParams; import com.alibaba.nacos.api.naming.NamingResponseCode; import com.alibaba.nacos.api.naming.PreservedMetadataKeys; import com.alibaba.nacos.api.naming.utils.NamingUtils; +import com.alibaba.nacos.auth.annotation.Secured; +import com.alibaba.nacos.auth.common.ActionTypes; import com.alibaba.nacos.common.utils.JacksonUtils; -import com.alibaba.nacos.core.auth.ActionTypes; -import com.alibaba.nacos.core.auth.Secured; import com.alibaba.nacos.core.utils.WebUtils; import com.alibaba.nacos.naming.core.Instance; import com.alibaba.nacos.naming.core.Service; diff --git a/naming/src/main/java/com/alibaba/nacos/naming/controllers/OperatorController.java b/naming/src/main/java/com/alibaba/nacos/naming/controllers/OperatorController.java index 30de8d2df..f0500924c 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/controllers/OperatorController.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/controllers/OperatorController.java @@ -17,9 +17,9 @@ package com.alibaba.nacos.naming.controllers; import com.alibaba.nacos.api.common.Constants; +import com.alibaba.nacos.auth.annotation.Secured; +import com.alibaba.nacos.auth.common.ActionTypes; import com.alibaba.nacos.common.utils.JacksonUtils; -import com.alibaba.nacos.core.auth.ActionTypes; -import com.alibaba.nacos.core.auth.Secured; import com.alibaba.nacos.core.cluster.Member; import com.alibaba.nacos.core.cluster.NodeState; import com.alibaba.nacos.core.cluster.ServerMemberManager; 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 f5265c7c7..a0b72c67d 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 @@ -21,10 +21,10 @@ import com.alibaba.nacos.api.exception.NacosException; import com.alibaba.nacos.api.naming.CommonParams; import com.alibaba.nacos.api.naming.utils.NamingUtils; import com.alibaba.nacos.api.selector.SelectorType; +import com.alibaba.nacos.auth.annotation.Secured; +import com.alibaba.nacos.auth.common.ActionTypes; import com.alibaba.nacos.common.utils.IoUtils; import com.alibaba.nacos.common.utils.JacksonUtils; -import com.alibaba.nacos.core.auth.ActionTypes; -import com.alibaba.nacos.core.auth.Secured; import com.alibaba.nacos.core.cluster.ServerMemberManager; import com.alibaba.nacos.core.utils.WebUtils; import com.alibaba.nacos.naming.core.Cluster; diff --git a/naming/src/main/java/com/alibaba/nacos/naming/web/NamingResourceParser.java b/naming/src/main/java/com/alibaba/nacos/naming/web/NamingResourceParser.java index 773a1df53..8024a215e 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/web/NamingResourceParser.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/web/NamingResourceParser.java @@ -18,8 +18,8 @@ package com.alibaba.nacos.naming.web; import com.alibaba.nacos.api.naming.CommonParams; import com.alibaba.nacos.api.naming.utils.NamingUtils; -import com.alibaba.nacos.core.auth.Resource; -import com.alibaba.nacos.core.auth.ResourceParser; +import com.alibaba.nacos.auth.model.Resource; +import com.alibaba.nacos.auth.parser.ResourceParser; import org.apache.commons.lang3.StringUtils; import javax.servlet.http.HttpServletRequest; diff --git a/naming/src/test/java/com/alibaba/nacos/naming/consistency/persistent/impl/NamingSnapshotOperationTest.java b/naming/src/test/java/com/alibaba/nacos/naming/consistency/persistent/impl/NamingSnapshotOperationTest.java index f1fada48b..ccb73f6c8 100644 --- a/naming/src/test/java/com/alibaba/nacos/naming/consistency/persistent/impl/NamingSnapshotOperationTest.java +++ b/naming/src/test/java/com/alibaba/nacos/naming/consistency/persistent/impl/NamingSnapshotOperationTest.java @@ -20,7 +20,7 @@ import com.alibaba.nacos.consistency.snapshot.Reader; import com.alibaba.nacos.consistency.snapshot.Writer; import com.alibaba.nacos.core.distributed.raft.RaftConfig; import com.alibaba.nacos.core.distributed.raft.utils.RaftExecutor; -import com.alibaba.nacos.core.storage.RocksStorage; +import com.alibaba.nacos.core.storage.kv.RocksStorage; import com.alibaba.nacos.core.utils.ApplicationUtils; import com.alibaba.nacos.core.utils.DiskUtils; import org.junit.After; diff --git a/test/src/test/java/com/alibaba/nacos/test/common/WatchFileCenter_ITCase.java b/test/src/test/java/com/alibaba/nacos/test/common/WatchFileCenter_ITCase.java index 89be3bb7d..044e0e8ee 100644 --- a/test/src/test/java/com/alibaba/nacos/test/common/WatchFileCenter_ITCase.java +++ b/test/src/test/java/com/alibaba/nacos/test/common/WatchFileCenter_ITCase.java @@ -30,6 +30,7 @@ import org.junit.BeforeClass; import org.junit.Test; import java.io.File; +import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Paths; import java.util.Set; @@ -175,8 +176,9 @@ public class WatchFileCenter_ITCase { DiskUtils.writeFile(file1, j.getBytes(StandardCharsets.UTF_8), false); } - } - finally { + } catch (IOException e) { + Assert.fail(e.getMessage()); + } finally { latch.countDown(); } }); diff --git a/test/src/test/java/com/alibaba/nacos/test/core/auth/AuthBase.java b/test/src/test/java/com/alibaba/nacos/test/core/auth/AuthBase.java index 306007880..33a088039 100644 --- a/test/src/test/java/com/alibaba/nacos/test/core/auth/AuthBase.java +++ b/test/src/test/java/com/alibaba/nacos/test/core/auth/AuthBase.java @@ -16,8 +16,8 @@ package com.alibaba.nacos.test.core.auth; import com.alibaba.nacos.api.PropertyKeyConst; +import com.alibaba.nacos.auth.common.AuthConfigs; import com.alibaba.nacos.common.utils.JacksonUtils; -import com.alibaba.nacos.core.auth.AuthConfigs; import com.alibaba.nacos.test.base.HttpClient4Test; import com.alibaba.nacos.test.base.Params; import com.fasterxml.jackson.databind.JsonNode; diff --git a/test/src/test/java/com/alibaba/nacos/test/core/auth/Permission_ITCase.java b/test/src/test/java/com/alibaba/nacos/test/core/auth/Permission_ITCase.java index 61c343db7..dbad58fe2 100644 --- a/test/src/test/java/com/alibaba/nacos/test/core/auth/Permission_ITCase.java +++ b/test/src/test/java/com/alibaba/nacos/test/core/auth/Permission_ITCase.java @@ -16,9 +16,9 @@ package com.alibaba.nacos.test.core.auth; import com.alibaba.nacos.Nacos; +import com.alibaba.nacos.auth.model.Permission; import com.alibaba.nacos.common.utils.JacksonUtils; import com.alibaba.nacos.config.server.model.Page; -import com.alibaba.nacos.core.auth.Permission; import com.alibaba.nacos.test.base.HttpClient4Test; import com.alibaba.nacos.test.base.Params; import com.fasterxml.jackson.core.type.TypeReference;