merge master

This commit is contained in:
wyp12 2018-10-17 19:45:35 +08:00
commit 251b2f01d8
232 changed files with 34378 additions and 979 deletions

1
.gitignore vendored
View File

@ -9,3 +9,4 @@ target
/logs /logs
*.iml *.iml
node_modules node_modules
test/derby.log

View File

@ -1,6 +1,7 @@
notifications: notifications:
email: email:
recipients: recipients:
- xchaos8@126.com
- nacos_dev@linux.alibaba.com - nacos_dev@linux.alibaba.com
- dev-nacos@googlegroups.com - dev-nacos@googlegroups.com
on_success: change on_success: change

View File

@ -1,3 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
@ -23,6 +36,10 @@
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId> <artifactId>fastjson</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -14,9 +14,8 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.alibaba.nacos.api.config.annotation; package com.alibaba.nacos.api.annotation;
import com.alibaba.nacos.api.PropertyKeyConst;
import com.alibaba.nacos.api.config.ConfigService; import com.alibaba.nacos.api.config.ConfigService;
import com.alibaba.nacos.api.naming.NamingService; import com.alibaba.nacos.api.naming.NamingService;
@ -28,8 +27,8 @@ import java.lang.annotation.*;
* @author <a href="mailto:mercyblitz@gmail.com">Mercy</a> * @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
* @see ConfigService * @see ConfigService
* @see NamingService * @see NamingService
* @see PropertyKeyConst * @see NacosProperties
* @since 0.1.0 * @since 0.2.1
*/ */
@Target({ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.METHOD, ElementType.ANNOTATION_TYPE}) @Target({ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.METHOD, ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@ -37,8 +36,7 @@ import java.lang.annotation.*;
public @interface NacosInjected { public @interface NacosInjected {
/** /**
* The {@link NacosProperties} attribute, If not specified, it will use * The {@link NacosProperties} attribute, If not specified, it will use global Nacos Properties.
* global Nacos Properties global Nacos Properties}.
* *
* @return the default value is {@link NacosProperties} * @return the default value is {@link NacosProperties}
*/ */

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.alibaba.nacos.api.config.annotation; package com.alibaba.nacos.api.annotation;
import com.alibaba.nacos.api.PropertyKeyConst; import com.alibaba.nacos.api.PropertyKeyConst;
@ -25,7 +25,7 @@ import java.lang.annotation.*;
* *
* @author <a href="mailto:mercyblitz@gmail.com">Mercy</a> * @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
* @see PropertyKeyConst * @see PropertyKeyConst
* @since 0.1.0 * @since 0.2.1
*/ */
@Target(ElementType.ANNOTATION_TYPE) @Target(ElementType.ANNOTATION_TYPE)
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@ -77,60 +77,108 @@ public @interface NacosProperties {
*/ */
String ENCODE = "encode"; String ENCODE = "encode";
/**
* The placeholder of endpoint, the value is <code>"${nacos.endpoint:}"</code>
*/
String ENDPOINT_PLACEHOLDER = "${" + PREFIX + ENDPOINT + ":}";
/**
* The placeholder of endpoint, the value is <code>"${nacos.namespace:}"</code>
*/
String NAMESPACE_PLACEHOLDER = "${" + PREFIX + NAMESPACE + ":}";
/**
* The placeholder of endpoint, the value is <code>"${nacos.access-key:}"</code>
*/
String ACCESS_KEY_PLACEHOLDER = "${" + PREFIX + ACCESS_KEY + ":}";
/**
* The placeholder of endpoint, the value is <code>"${nacos.secret-key:}"</code>
*/
String SECRET_KEY_PLACEHOLDER = "${" + PREFIX + SECRET_KEY + ":}";
/**
* The placeholder of endpoint, the value is <code>${nacos.server-addr:}"</code>
*/
String SERVER_ADDR_PLACEHOLDER = "${" + PREFIX + SERVER_ADDR + ":}";
/**
* The placeholder of endpoint, the value is ${nacos.context-path:}"
*/
String CONTEXT_PATH_PLACEHOLDER = "${" + PREFIX + CONTEXT_PATH + ":}";
/**
* The placeholder of endpoint, the value is <code>"${nacos.cluster-name:}"</code>
*/
String CLUSTER_NAME_PLACEHOLDER = "${" + PREFIX + CLUSTER_NAME + ":}";
/**
* The placeholder of {@link NacosProperties#ENCODE encode}, the value is <code>"${nacos.encode:UTF-8}"</code>
*/
String ENCODE_PLACEHOLDER = "${" + PREFIX + ENCODE + ":UTF-8}";
/** /**
* The property of "endpoint" * The property of "endpoint"
* *
* @return empty as default value * @return empty as default value
* @see #ENDPOINT_PLACEHOLDER
*/ */
String endpoint() default "${" + PREFIX + ENDPOINT + ":}"; String endpoint() default ENDPOINT_PLACEHOLDER;
/** /**
* The property of "namespace" * The property of "namespace"
* *
* @return empty as default value * @return empty as default value
* @see #NAMESPACE_PLACEHOLDER
*/ */
String namespace() default "${" + PREFIX + NAMESPACE + ":}"; String namespace() default NAMESPACE_PLACEHOLDER;
/** /**
* The property of "access-key" * The property of "access-key"
* *
* @return empty as default value * @return empty as default value
* @see #ACCESS_KEY_PLACEHOLDER
*/ */
String accessKey() default "${" + PREFIX + ACCESS_KEY + ":}"; String accessKey() default ACCESS_KEY_PLACEHOLDER;
/** /**
* The property of "secret-key" * The property of "secret-key"
* *
* @return empty as default value * @return empty as default value
* @see #SECRET_KEY_PLACEHOLDER
*/ */
String secretKey() default "${" + PREFIX + SECRET_KEY + ":}"; String secretKey() default SECRET_KEY_PLACEHOLDER;
/** /**
* The property of "server-addr" * The property of "server-addr"
* *
* @return empty as default value * @return empty as default value
* @see #SERVER_ADDR_PLACEHOLDER
*/ */
String serverAddr() default "${" + PREFIX + SERVER_ADDR + ":}"; String serverAddr() default SERVER_ADDR_PLACEHOLDER;
/** /**
* The property of "context-path" * The property of "context-path"
* *
* @return empty as default value * @return empty as default value
* @see #CONTEXT_PATH_PLACEHOLDER
*/ */
String contextPath() default "${" + PREFIX + CONTEXT_PATH + ":}"; String contextPath() default CONTEXT_PATH_PLACEHOLDER;
/** /**
* The property of "cluster-name" * The property of "cluster-name"
* *
* @return empty as default value * @return empty as default value
* @see #CLUSTER_NAME_PLACEHOLDER
*/ */
String clusterName() default "${" + PREFIX + CLUSTER_NAME + ":}"; String clusterName() default CLUSTER_NAME_PLACEHOLDER;
/** /**
* The property of "encode" * The property of "encode"
* *
* @return "UTF-8" as default value * @return "UTF-8" as default value
* @see #ENCODE_PLACEHOLDER
*/ */
String encode() default "${" + PREFIX + ENCODE + ":UTF-8}"; String encode() default ENCODE_PLACEHOLDER;
} }

View File

@ -39,8 +39,6 @@ public class Constants {
public static final String DAILY_DOMAINNAME = "commonconfig.taobao.net"; public static final String DAILY_DOMAINNAME = "commonconfig.taobao.net";
public static final int DEFAULT_PORT = 8080;
public static final String NULL = ""; public static final String NULL = "";
public static final String DATAID = "dataId"; public static final String DATAID = "dataId";
@ -124,4 +122,8 @@ public class Constants {
public static final String CLIENT_REQUEST_TOKEN_HEADER = "Client-RequestToken"; public static final String CLIENT_REQUEST_TOKEN_HEADER = "Client-RequestToken";
public static final int ATOMIC_MAX_SIZE = 1000; public static final int ATOMIC_MAX_SIZE = 1000;
public static final String NAMING_INSTANCE_ID_SPLITTER = "#";
public static final int NAMING_INSTANCE_ID_SEG_COUNT = 4;
public static final String NAMING_HTTP_HEADER_SPILIER = "\\|";
} }

View File

@ -16,6 +16,7 @@
*/ */
package com.alibaba.nacos.api.config.annotation; package com.alibaba.nacos.api.config.annotation;
import com.alibaba.nacos.api.annotation.NacosProperties;
import com.alibaba.nacos.api.common.Constants; import com.alibaba.nacos.api.common.Constants;
import com.alibaba.nacos.api.config.convert.NacosConfigConverter; import com.alibaba.nacos.api.config.convert.NacosConfigConverter;
@ -27,7 +28,7 @@ import static com.alibaba.nacos.api.common.Constants.DEFAULT_GROUP;
* Annotation that marks a method as a listener for Nacos Config change. * Annotation that marks a method as a listener for Nacos Config change.
* *
* @author <a href="mailto:mercyblitz@gmail.com">Mercy</a> * @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
* @since 0.1.0 * @since 0.2.0
*/ */
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD) @Target(ElementType.METHOD)

View File

@ -17,6 +17,7 @@
package com.alibaba.nacos.api.config.annotation; package com.alibaba.nacos.api.config.annotation;
import com.alibaba.nacos.api.PropertyKeyConst; import com.alibaba.nacos.api.PropertyKeyConst;
import com.alibaba.nacos.api.annotation.NacosProperties;
import com.alibaba.nacos.api.common.Constants; import com.alibaba.nacos.api.common.Constants;
import java.lang.annotation.*; import java.lang.annotation.*;
@ -29,7 +30,7 @@ import static com.alibaba.nacos.api.common.Constants.DEFAULT_GROUP;
* *
* @author <a href="mailto:mercyblitz@gmail.com">Mercy</a> * @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
* @see PropertyKeyConst * @see PropertyKeyConst
* @since 0.1.0 * @since 0.2.0
*/ */
@Target({ElementType.TYPE}) @Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)

View File

@ -25,7 +25,7 @@ import java.lang.annotation.*;
* @author <a href="mailto:mercyblitz@gmail.com">Mercy</a> * @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
* @see NacosConfigurationProperties * @see NacosConfigurationProperties
* @see NacosProperty * @see NacosProperty
* @since 0.1.0 * @since 0.2.0
*/ */
@Target({ElementType.FIELD}) @Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)

View File

@ -26,7 +26,7 @@ import java.lang.annotation.*;
* @author <a href="mailto:mercyblitz@gmail.com">Mercy</a> * @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
* @see NacosConfigurationProperties * @see NacosConfigurationProperties
* @see NacosIgnore * @see NacosIgnore
* @since 0.1.0 * @since 0.2.0
*/ */
@Target({ElementType.FIELD}) @Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)

View File

@ -22,7 +22,7 @@ import java.lang.annotation.*;
* Annotation which extends value to support auto-refresh * Annotation which extends value to support auto-refresh
* *
* @author <a href="mailto:huangxiaoyu1018@gmail.com">hxy1991</a> * @author <a href="mailto:huangxiaoyu1018@gmail.com">hxy1991</a>
* @since 0.1.0 * @since 0.2.0
*/ */
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE}) @Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)

View File

@ -21,7 +21,7 @@ package com.alibaba.nacos.api.config.convert;
* *
* @param <T> the target type that wanted * @param <T> the target type that wanted
* @author <a href="mailto:mercyblitz@gmail.com">Mercy</a> * @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
* @since 0.1.0 * @since 0.2.0
*/ */
public interface NacosConfigConverter<T> { public interface NacosConfigConverter<T> {

View File

@ -15,6 +15,13 @@
*/ */
package com.alibaba.nacos.api.naming.pojo; package com.alibaba.nacos.api.naming.pojo;
import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.nacos.api.common.Constants;
import org.apache.commons.lang3.StringUtils;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects; import java.util.Objects;
/** /**
@ -32,6 +39,14 @@ public abstract class AbstractHealthChecker implements Cloneable {
this.type = type; this.type = type;
} }
/**
* Clone all fields of this instance to another one
*
* @return Another instance with exactly the same fields.
* @throws CloneNotSupportedException
*/
public abstract AbstractHealthChecker clone() throws CloneNotSupportedException;
public static class Http extends AbstractHealthChecker { public static class Http extends AbstractHealthChecker {
public static final String TYPE = "HTTP"; public static final String TYPE = "HTTP";
@ -68,6 +83,25 @@ public abstract class AbstractHealthChecker implements Cloneable {
this.headers = headers; this.headers = headers;
} }
@JSONField(serialize = false)
public Map<String, String> getCustomHeaders() {
if (StringUtils.isBlank(headers)) {
return Collections.emptyMap();
}
Map<String, String> headerMap = new HashMap<String, String>(16);
for (String s : headers.split(Constants.NAMING_HTTP_HEADER_SPILIER)) {
String[] splits = s.split(":");
if (splits.length != 2) {
continue;
}
headerMap.put(StringUtils.trim(splits[0]), StringUtils.trim(splits[1]));
}
return headerMap;
}
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(path, headers, expectedResponseCode); return Objects.hash(path, headers, expectedResponseCode);
@ -93,6 +127,18 @@ public abstract class AbstractHealthChecker implements Cloneable {
} }
return expectedResponseCode == other.getExpectedResponseCode(); return expectedResponseCode == other.getExpectedResponseCode();
} }
@Override
public Http clone() throws CloneNotSupportedException {
Http config = new Http();
config.setPath(this.getPath());
config.setHeaders(this.getHeaders());
config.setType(this.getType());
config.setExpectedResponseCode(this.getExpectedResponseCode());
return config;
}
} }
public static class Tcp extends AbstractHealthChecker { public static class Tcp extends AbstractHealthChecker {
@ -112,6 +158,12 @@ public abstract class AbstractHealthChecker implements Cloneable {
return obj instanceof Tcp; return obj instanceof Tcp;
} }
public Tcp clone() throws CloneNotSupportedException {
Tcp config = new Tcp();
config.setType(this.type);
return config;
}
} }
public static class Mysql extends AbstractHealthChecker { public static class Mysql extends AbstractHealthChecker {
@ -173,6 +225,17 @@ public abstract class AbstractHealthChecker implements Cloneable {
return strEquals(cmd, other.getCmd()); return strEquals(cmd, other.getCmd());
} }
@Override
public Mysql clone() throws CloneNotSupportedException {
Mysql config = new Mysql();
config.setUser(this.getUser());
config.setPwd(this.getPwd());
config.setCmd(this.getCmd());
config.setType(this.getType());
return config;
}
} }
private static boolean strEquals(String str1, String str2) { private static boolean strEquals(String str1, String str2) {

View File

@ -54,7 +54,7 @@ public class Cluster {
private boolean useIPPort4Check = true; private boolean useIPPort4Check = true;
private Map<String, String> metadata = new HashMap<>(); private Map<String, String> metadata = new HashMap<String, String>();
public Cluster() { public Cluster() {

View File

@ -17,6 +17,7 @@ package com.alibaba.nacos.api.naming.pojo;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.nacos.api.common.Constants;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -52,6 +53,8 @@ public class Instance {
@JSONField(name = "valid") @JSONField(name = "valid")
private boolean healthy = true; private boolean healthy = true;
private boolean enabled = true;
/** /**
* Cluster information of instance * Cluster information of instance
*/ */
@ -67,7 +70,7 @@ public class Instance {
/** /**
* User extended attributes * User extended attributes
*/ */
private Map<String, String> metadata = new HashMap<>(); private Map<String, String> metadata = new HashMap<String, String>();
public String getInstanceId() { public String getInstanceId() {
return instanceId; return instanceId;
@ -77,6 +80,14 @@ public class Instance {
this.instanceId = instanceId; this.instanceId = instanceId;
} }
public String serviceName() {
String[] infos = instanceId.split(Constants.NAMING_INSTANCE_ID_SPLITTER);
if (infos.length < Constants.NAMING_INSTANCE_ID_SEG_COUNT) {
return null;
}
return infos[Constants.NAMING_INSTANCE_ID_SEG_COUNT - 1];
}
public String getIp() { public String getIp() {
return ip; return ip;
} }
@ -137,6 +148,14 @@ public class Instance {
this.metadata.put(key, value); this.metadata.put(key, value);
} }
public boolean isEnabled() {
return enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
@Override @Override
public String toString() { public String toString() {
return JSON.toJSONString(this); return JSON.toJSONString(this);

View File

@ -1,3 +1,18 @@
/*
* 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.api.naming.pojo; package com.alibaba.nacos.api.naming.pojo;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;

View File

@ -52,7 +52,7 @@ public class Service {
this.name = name; this.name = name;
} }
private Map<String, String> metadata = new HashMap<>(); private Map<String, String> metadata = new HashMap<String, String>();
public String getName() { public String getName() {
return name; return name;

View File

@ -16,7 +16,7 @@
package com.alibaba.nacos.api.naming.pojo; package com.alibaba.nacos.api.naming.pojo;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.nacos.api.naming.pojo.Instance;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
@ -155,7 +155,7 @@ public class ServiceInfo {
public List<Instance> getHosts() { public List<Instance> getHosts() {
return new ArrayList<>(hosts); return new ArrayList<Instance>(hosts);
} }
public boolean validate() { public boolean validate() {
@ -163,10 +163,6 @@ public class ServiceInfo {
return true; return true;
} }
if (isEmpty(hosts)) {
return false;
}
List<Instance> validHosts = new ArrayList<Instance>(); List<Instance> validHosts = new ArrayList<Instance>();
for (Instance host : hosts) { for (Instance host : hosts) {
if (!host.isHealthy()) { if (!host.isHealthy()) {
@ -178,10 +174,6 @@ public class ServiceInfo {
} }
} }
if (isEmpty(validHosts)) {
return false;
}
return true; return true;
} }

View File

@ -0,0 +1,78 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.api.annotation;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.mock.env.MockEnvironment;
import static com.alibaba.nacos.api.annotation.NacosProperties.*;
/**
* {@link NacosProperties} Test
*
* @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
* @since 0.2.1
*/
public class NacosPropertiesTest {
@Test
public void testPlaceholders() {
Assert.assertEquals("${nacos.endpoint:}", ENDPOINT_PLACEHOLDER);
Assert.assertEquals("${nacos.namespace:}", NAMESPACE_PLACEHOLDER);
Assert.assertEquals("${nacos.access-key:}", ACCESS_KEY_PLACEHOLDER);
Assert.assertEquals("${nacos.secret-key:}", SECRET_KEY_PLACEHOLDER);
Assert.assertEquals("${nacos.server-addr:}", SERVER_ADDR_PLACEHOLDER);
Assert.assertEquals("${nacos.context-path:}", CONTEXT_PATH_PLACEHOLDER);
Assert.assertEquals("${nacos.cluster-name:}", CLUSTER_NAME_PLACEHOLDER);
Assert.assertEquals("${nacos.encode:UTF-8}", ENCODE_PLACEHOLDER);
}
@Test
public void testResolvePlaceholders() {
testResolvePlaceholder(ENDPOINT_PLACEHOLDER, "nacos.endpoint", "test-value", "test-value");
testResolvePlaceholder(ENDPOINT_PLACEHOLDER, "", "test-value", "");
testResolvePlaceholder(NAMESPACE_PLACEHOLDER, "nacos.namespace", "test-value", "test-value");
testResolvePlaceholder(NAMESPACE_PLACEHOLDER, "", "test-value", "");
testResolvePlaceholder(ACCESS_KEY_PLACEHOLDER, "nacos.access-key", "test-value", "test-value");
testResolvePlaceholder(ACCESS_KEY_PLACEHOLDER, "", "test-value", "");
testResolvePlaceholder(SECRET_KEY_PLACEHOLDER, "nacos.secret-key", "test-value", "test-value");
testResolvePlaceholder(SECRET_KEY_PLACEHOLDER, "", "test-value", "");
testResolvePlaceholder(SERVER_ADDR_PLACEHOLDER, "nacos.server-addr", "test-value", "test-value");
testResolvePlaceholder(SERVER_ADDR_PLACEHOLDER, "", "test-value", "");
testResolvePlaceholder(CONTEXT_PATH_PLACEHOLDER, "nacos.context-path", "test-value", "test-value");
testResolvePlaceholder(CONTEXT_PATH_PLACEHOLDER, "", "test-value", "");
testResolvePlaceholder(CLUSTER_NAME_PLACEHOLDER, "nacos.cluster-name", "test-value", "test-value");
testResolvePlaceholder(CLUSTER_NAME_PLACEHOLDER, "", "test-value", "");
testResolvePlaceholder(ENCODE_PLACEHOLDER, "nacos.encode", "test-value", "test-value");
testResolvePlaceholder(ENCODE_PLACEHOLDER, "", "test-value", "UTF-8");
}
private void testResolvePlaceholder(String placeholder, String propertyName, String propertyValue, String expectValue) {
MockEnvironment environment = new MockEnvironment();
environment.setProperty(propertyName, propertyValue);
String resolvedValue = environment.resolvePlaceholders(placeholder);
Assert.assertEquals(expectValue, resolvedValue);
}
}

View File

@ -1,9 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<groupId>com.alibaba.nacos</groupId> <groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId> <artifactId>nacos-all</artifactId>
<version>0.2.0-SM-SNAPSHOT</version> <version>0.2.0-SM-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -30,6 +30,7 @@ import com.alibaba.nacos.client.naming.core.EventDispatcher;
import com.alibaba.nacos.client.naming.core.HostReactor; import com.alibaba.nacos.client.naming.core.HostReactor;
import com.alibaba.nacos.client.naming.net.NamingProxy; import com.alibaba.nacos.client.naming.net.NamingProxy;
import com.alibaba.nacos.client.naming.utils.CollectionUtils; import com.alibaba.nacos.client.naming.utils.CollectionUtils;
import com.alibaba.nacos.client.naming.utils.LogUtils;
import com.alibaba.nacos.client.naming.utils.StringUtils; import com.alibaba.nacos.client.naming.utils.StringUtils;
import com.alibaba.nacos.client.naming.utils.UtilAndComs; import com.alibaba.nacos.client.naming.utils.UtilAndComs;
@ -78,6 +79,13 @@ public class NacosNamingService implements NamingService {
logName = "naming.log"; logName = "naming.log";
} }
String logLevel = System.getProperty(UtilAndComs.NACOS_NAMING_LOG_LEVEL);
if (StringUtils.isEmpty(logLevel)) {
logLevel = "INFO";
}
LogUtils.setLogLevel(logLevel);
cacheDir = System.getProperty("com.alibaba.nacos.naming.cache.dir"); cacheDir = System.getProperty("com.alibaba.nacos.naming.cache.dir");
if (StringUtils.isEmpty(cacheDir)) { if (StringUtils.isEmpty(cacheDir)) {
cacheDir = System.getProperty("user.home") + "/nacos/naming/" + namespace; cacheDir = System.getProperty("user.home") + "/nacos/naming/" + namespace;
@ -174,7 +182,7 @@ public class NacosNamingService implements NamingService {
ServiceInfo serviceInfo = hostReactor.getServiceInfo(serviceName, StringUtils.join(clusters, ","), StringUtils.EMPTY, false); ServiceInfo serviceInfo = hostReactor.getServiceInfo(serviceName, StringUtils.join(clusters, ","), StringUtils.EMPTY, false);
List<Instance> list; List<Instance> list;
if (serviceInfo == null || CollectionUtils.isEmpty(list = serviceInfo.getHosts())) { if (serviceInfo == null || CollectionUtils.isEmpty(list = serviceInfo.getHosts())) {
throw new IllegalStateException("no host to srv for dom: " + serviceName); return new ArrayList<Instance>();
} }
return list; return list;
} }
@ -190,7 +198,7 @@ public class NacosNamingService implements NamingService {
ServiceInfo serviceInfo = hostReactor.getServiceInfo(serviceName, StringUtils.join(clusters, ","), StringUtils.EMPTY, false); ServiceInfo serviceInfo = hostReactor.getServiceInfo(serviceName, StringUtils.join(clusters, ","), StringUtils.EMPTY, false);
List<Instance> list; List<Instance> list;
if (serviceInfo == null || CollectionUtils.isEmpty(list = serviceInfo.getHosts())) { if (serviceInfo == null || CollectionUtils.isEmpty(list = serviceInfo.getHosts())) {
throw new IllegalStateException("no host to srv for dom: " + serviceName); return new ArrayList<Instance>();
} }
if (healthy) { if (healthy) {
@ -251,7 +259,7 @@ public class NacosNamingService implements NamingService {
@Override @Override
public List<ServiceInfo> getSubscribeServices() { public List<ServiceInfo> getSubscribeServices() {
return new ArrayList<>(hostReactor.getServiceInfoMap().values()); return new ArrayList<ServiceInfo>(hostReactor.getServiceInfoMap().values());
} }
@Override @Override

View File

@ -23,21 +23,21 @@ import com.alibaba.nacos.client.naming.utils.UtilAndComs;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.*;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
/** /**
* @author harold * @author harold
*/ */
public class BeatReactor { public class BeatReactor {
private ScheduledExecutorService executorService = new ScheduledThreadPoolExecutor(1, r -> { private ScheduledExecutorService executorService = new ScheduledThreadPoolExecutor(1, new ThreadFactory() {
@Override
public Thread newThread(Runnable r) {
Thread thread = new Thread(r); Thread thread = new Thread(r);
thread.setDaemon(true); thread.setDaemon(true);
thread.setName("com.alibaba.nacos.naming.beat.sender"); thread.setName("com.alibaba.nacos.naming.beat.sender");
return thread; return thread;
}
}); });
private long clientBeatInterval = 10 * 1000; private long clientBeatInterval = 10 * 1000;
@ -52,10 +52,12 @@ public class BeatReactor {
} }
public void addBeatInfo(String dom, BeatInfo beatInfo) { public void addBeatInfo(String dom, BeatInfo beatInfo) {
LogUtils.LOG.info("BEAT", "adding service:" + dom + " to beat map.");
dom2Beat.put(dom, beatInfo); dom2Beat.put(dom, beatInfo);
} }
public void removeBeatInfo(String dom) { public void removeBeatInfo(String dom) {
LogUtils.LOG.info("BEAT", "removing service:" + dom + " from beat map.");
dom2Beat.remove(dom); dom2Beat.remove(dom);
} }
@ -67,7 +69,7 @@ public class BeatReactor {
for (Map.Entry<String, BeatInfo> entry : dom2Beat.entrySet()) { for (Map.Entry<String, BeatInfo> entry : dom2Beat.entrySet()) {
BeatInfo beatInfo = entry.getValue(); BeatInfo beatInfo = entry.getValue();
executorService.schedule(new BeatTask(beatInfo), 0, TimeUnit.MILLISECONDS); executorService.schedule(new BeatTask(beatInfo), 0, TimeUnit.MILLISECONDS);
LogUtils.LOG.info("BEAT", "send beat to server: ", beatInfo.toString()); LogUtils.LOG.debug("BEAT", "send beat to server: ", beatInfo.toString());
} }
} catch (Exception e) { } catch (Exception e) {
LogUtils.LOG.error("CLIENT-BEAT", "Exception while scheduling beat.", e); LogUtils.LOG.error("CLIENT-BEAT", "Exception while scheduling beat.", e);

View File

@ -60,6 +60,8 @@ public class EventDispatcher {
} }
public void addListener(ServiceInfo serviceInfo, String clusters, String env, EventListener listener) { public void addListener(ServiceInfo serviceInfo, String clusters, String env, EventListener listener) {
LogUtils.LOG.info("LISTENER", "adding " + serviceInfo.getName() + " with " + clusters + " to listener map");
List<EventListener> observers = Collections.synchronizedList(new ArrayList<EventListener>()); List<EventListener> observers = Collections.synchronizedList(new ArrayList<EventListener>());
observers.add(listener); observers.add(listener);
@ -72,6 +74,8 @@ public class EventDispatcher {
} }
public void removeListener(String serviceName, String clusters, EventListener listener) { public void removeListener(String serviceName, String clusters, EventListener listener) {
LogUtils.LOG.info("LISTENER", "removing " + serviceName + " with " + clusters + " from listener map");
String unit = ""; String unit = "";
List<EventListener> observers = observerMap.get(ServiceInfo.getKey(serviceName, clusters, unit)); List<EventListener> observers = observerMap.get(ServiceInfo.getKey(serviceName, clusters, unit));
@ -114,11 +118,9 @@ public class EventDispatcher {
if (!CollectionUtils.isEmpty(listeners)) { if (!CollectionUtils.isEmpty(listeners)) {
for (EventListener listener : listeners) { for (EventListener listener : listeners) {
List<Instance> hosts = Collections.unmodifiableList(serviceInfo.getHosts()); List<Instance> hosts = Collections.unmodifiableList(serviceInfo.getHosts());
if (!CollectionUtils.isEmpty(hosts)) {
listener.onEvent(new NamingEvent(serviceInfo.getName(), hosts)); listener.onEvent(new NamingEvent(serviceInfo.getName(), hosts));
} }
} }
}
} catch (Exception e) { } catch (Exception e) {
LogUtils.LOG.error("NA", "notify error for service: " LogUtils.LOG.error("NA", "notify error for service: "

View File

@ -43,6 +43,8 @@ public class HostReactor {
private Map<String, ServiceInfo> serviceInfoMap; private Map<String, ServiceInfo> serviceInfoMap;
private Map<String, Object> updatingMap;
private PushRecver pushRecver; private PushRecver pushRecver;
private EventDispatcher eventDispatcher; private EventDispatcher eventDispatcher;
@ -57,7 +59,8 @@ public class HostReactor {
this.eventDispatcher = eventDispatcher; this.eventDispatcher = eventDispatcher;
this.serverProxy = serverProxy; this.serverProxy = serverProxy;
this.cacheDir = cacheDir; this.cacheDir = cacheDir;
this.serviceInfoMap = new ConcurrentHashMap<>(DiskCache.read(this.cacheDir)); this.serviceInfoMap = new ConcurrentHashMap<String, ServiceInfo>(DiskCache.read(this.cacheDir));
this.updatingMap = new ConcurrentHashMap<String, Object>();
this.failoverReactor = new FailoverReactor(this, cacheDir); this.failoverReactor = new FailoverReactor(this, cacheDir);
this.pushRecver = new PushRecver(this); this.pushRecver = new PushRecver(this);
} }
@ -110,7 +113,7 @@ public class HostReactor {
Set<Instance> newHosts = new HashSet<Instance>(); Set<Instance> newHosts = new HashSet<Instance>();
Set<Instance> remvHosts = new HashSet<Instance>(); Set<Instance> remvHosts = new HashSet<Instance>();
List<Map.Entry<String, Instance>> newServiceHosts = new ArrayList<>(newHostMap.entrySet()); List<Map.Entry<String, Instance>> newServiceHosts = new ArrayList<Map.Entry<String, Instance>>(newHostMap.entrySet());
for (Map.Entry<String, Instance> entry : newServiceHosts) { for (Map.Entry<String, Instance> entry : newServiceHosts) {
Instance host = entry.getValue(); Instance host = entry.getValue();
String key = entry.getKey(); String key = entry.getKey();
@ -218,12 +221,16 @@ public class HostReactor {
serviceInfoMap.put(serviceObj.getKey(), serviceObj); serviceInfoMap.put(serviceObj.getKey(), serviceObj);
updatingMap.put(serviceName, new Object());
if (allIPs) { if (allIPs) {
updateService4AllIPNow(serviceName, clusters, env); updateService4AllIPNow(serviceName, clusters, env);
} else { } else {
updateServiceNow(serviceName, clusters, env); updateServiceNow(serviceName, clusters, env);
} }
} else if (serviceObj.getHosts().isEmpty()) { updatingMap.remove(serviceName);
} else if (updatingMap.containsKey(serviceName)) {
if (updateHoldInterval > 0) { if (updateHoldInterval > 0) {
// hold a moment waiting for update finish // hold a moment waiting for update finish

View File

@ -70,7 +70,7 @@ public class HttpClient {
conn.setRequestMethod(method); conn.setRequestMethod(method);
setHeaders(conn, headers, encoding); setHeaders(conn, headers, encoding);
conn.connect(); conn.connect();
LogUtils.LOG.info("Request from server: " + url); LogUtils.LOG.debug("Request from server: " + url);
return getResult(conn); return getResult(conn);
} catch (Exception e) { } catch (Exception e) {
try { try {

View File

@ -38,6 +38,8 @@ import java.util.concurrent.TimeUnit;
*/ */
public class NamingProxy { public class NamingProxy {
private static final int DEFAULT_SERVER_PORT = 8848;
private String namespace; private String namespace;
private String endpoint; private String endpoint;
@ -46,7 +48,7 @@ public class NamingProxy {
private List<String> serverList; private List<String> serverList;
private List<String> serversFromEndpoint = new ArrayList<>(); private List<String> serversFromEndpoint = new ArrayList<String>();
private long lastSrvRefTime = 0L; private long lastSrvRefTime = 0L;
@ -122,7 +124,7 @@ public class NamingProxy {
try { try {
if (!CollectionUtils.isEmpty(serverList)) { if (!CollectionUtils.isEmpty(serverList)) {
LogUtils.LOG.info("server list provided by user: " + serverList); LogUtils.LOG.debug("server list provided by user: " + serverList);
return; return;
} }
@ -147,34 +149,16 @@ public class NamingProxy {
} }
} }
public void regDom(String dom, String ip, int port, double weight, String cluster) throws NacosException {
final Map<String, String> params = new HashMap<String, String>(8);
params.put("dom", dom);
params.put("ip", ip);
params.put("port", String.valueOf(port));
params.put("weight", String.valueOf(weight));
params.put("cluster", cluster);
try {
doRegDom(params);
} catch (Exception e) {
try {
Thread.sleep(1000L);
doRegDom(params);
} catch (Exception e1) {
throw new NacosException(NacosException.SERVER_ERROR, e.getMessage());
}
}
}
public void registerService(String serviceName, Instance instance) throws NacosException { public void registerService(String serviceName, Instance instance) throws NacosException {
final Map<String, String> params = new HashMap<>(8); LogUtils.LOG.info("REGISTER-SERVICE", "registering service " + serviceName + " with instance:" + instance);
final Map<String, String> params = new HashMap<String, String>(8);
params.put("tenant", namespace); params.put("tenant", namespace);
params.put("ip", instance.getIp()); params.put("ip", instance.getIp());
params.put("port", String.valueOf(instance.getPort())); params.put("port", String.valueOf(instance.getPort()));
params.put("weight", String.valueOf(instance.getWeight())); params.put("weight", String.valueOf(instance.getWeight()));
params.put("enable", String.valueOf(instance.isEnabled()));
params.put("healthy", String.valueOf(instance.isHealthy())); params.put("healthy", String.valueOf(instance.isHealthy()));
params.put("metadata", JSON.toJSONString(instance.getMetadata())); params.put("metadata", JSON.toJSONString(instance.getMetadata()));
if (instance.getService() == null) { if (instance.getService() == null) {
@ -189,7 +173,10 @@ public class NamingProxy {
public void deregisterService(String serviceName, String ip, int port, String cluster) throws NacosException { public void deregisterService(String serviceName, String ip, int port, String cluster) throws NacosException {
final Map<String, String> params = new HashMap<>(8); LogUtils.LOG.info("DEREGISTER-SERVICE", "deregistering service " + serviceName
+ " with instance:" + ip + ":" + port + "@" + cluster);
final Map<String, String> params = new HashMap<String, String>(8);
params.put("tenant", namespace); params.put("tenant", namespace);
params.put("ip", ip); params.put("ip", ip);
params.put("port", String.valueOf(port)); params.put("port", String.valueOf(port));
@ -201,13 +188,13 @@ public class NamingProxy {
public String queryList(String serviceName, String clusters, boolean healthyOnly) throws NacosException { public String queryList(String serviceName, String clusters, boolean healthyOnly) throws NacosException {
final Map<String, String> params = new HashMap<>(8); final Map<String, String> params = new HashMap<String, String>(8);
params.put("tenant", namespace); params.put("tenant", namespace);
params.put("serviceName", serviceName); params.put("serviceName", serviceName);
params.put("clusters", clusters); params.put("clusters", clusters);
params.put("healthyOnly", String.valueOf(healthyOnly)); params.put("healthyOnly", String.valueOf(healthyOnly));
return reqAPI(UtilAndComs.NACOS_URL_BASE + "/instances", params, "GET"); return reqAPI(UtilAndComs.NACOS_URL_BASE + "/instance/list", params, "GET");
} }
private String doRegDom(Map<String, String> params) throws Exception { private String doRegDom(Map<String, String> params) throws Exception {
@ -215,28 +202,10 @@ public class NamingProxy {
return reqAPI(api, params); return reqAPI(api, params);
} }
public void deRegDom(String dom, String ip, int port, String cluster) throws NacosException {
String api = UtilAndComs.NACOS_URL_BASE + "/api/deRegService";
Map<String, String> params = new HashMap<String, String>(8);
params.put("ip", ip);
params.put("port", String.valueOf(port));
params.put("cluster", cluster);
params.put("dom", dom);
params.put("tenant", namespace);
try {
reqAPI(api, params);
} catch (Exception e) {
LogUtils.LOG.error("NA", "faild to deRegDom: " + JSON.toJSONString(params), e);
}
}
public boolean serverHealthy() { public boolean serverHealthy() {
try { try {
reqAPI(UtilAndComs.NACOS_URL_BASE + "/api/hello", new HashMap<>(2)); reqAPI(UtilAndComs.NACOS_URL_BASE + "/api/hello", new HashMap<String, String>(2));
} catch (Exception e) { } catch (Exception e) {
return false; return false;
} }
@ -253,7 +222,7 @@ public class NamingProxy {
String result = reqAPI(UtilAndComs.NACOS_URL_BASE + "/service/list", params); String result = reqAPI(UtilAndComs.NACOS_URL_BASE + "/service/list", params);
JSONObject json = JSON.parseObject(result); JSONObject json = JSON.parseObject(result);
ListView<String> listView = new ListView<>(); ListView<String> listView = new ListView<String>();
listView.setCount(json.getInteger("count")); listView.setCount(json.getInteger("count"));
listView.setData(JSON.parseObject(json.getString("doms"), new TypeReference<List<String>>() { listView.setData(JSON.parseObject(json.getString("doms"), new TypeReference<List<String>>() {
})); }));
@ -316,6 +285,10 @@ public class NamingProxy {
String url; String url;
if (!curServer.contains(UtilAndComs.SERVER_ADDR_IP_SPLITER)) {
curServer = curServer + UtilAndComs.SERVER_ADDR_IP_SPLITER + DEFAULT_SERVER_PORT;
}
url = HttpClient.getPrefix() + curServer + api; url = HttpClient.getPrefix() + curServer + api;
HttpClient.HttpResult result = HttpClient.request(url, headers, params, UtilAndComs.ENCODING, method); HttpClient.HttpResult result = HttpClient.request(url, headers, params, UtilAndComs.ENCODING, method);

View File

@ -51,4 +51,8 @@ public class LogUtils {
return LoggerFactory.getLogger(clazz); return LoggerFactory.getLogger(clazz);
} }
public static void setLogLevel(String level) {
LOG.setLevel(Level.codeOf(level.toUpperCase()));
}
} }

View File

@ -20,7 +20,7 @@ package com.alibaba.nacos.client.naming.utils;
*/ */
public class UtilAndComs { public class UtilAndComs {
public static final String VERSION = "Nacos-Client-0.1"; public static final String VERSION = "Nacos-Java-Client:v0.2.1";
public static final String ENCODING = "UTF-8"; public static final String ENCODING = "UTF-8";
@ -41,4 +41,8 @@ public class UtilAndComs {
public static final String DEFAULT_NAMING_ID = "default"; public static final String DEFAULT_NAMING_ID = "default";
public static final String NACOS_NAMING_LOG_NAME = "com.alibaba.nacos.naming.log.filename"; public static final String NACOS_NAMING_LOG_NAME = "com.alibaba.nacos.naming.log.filename";
public static final String NACOS_NAMING_LOG_LEVEL = "com.alibaba.nacos.naming.log.level";
public static final String SERVER_ADDR_IP_SPLITER = ":";
} }

View File

@ -46,7 +46,7 @@ public class ParamUtil {
appName = AppNameUtils.getAppName(); appName = AppNameUtils.getAppName();
String defaultServerPortTmp = "8080"; String defaultServerPortTmp = "8848";
defaultServerPort = System.getProperty("nacos.server.port", defaultServerPortTmp); defaultServerPort = System.getProperty("nacos.server.port", defaultServerPortTmp);
log.info("settings", "[req-serv] nacos-server port:{}", defaultServerPort); log.info("settings", "[req-serv] nacos-server port:{}", defaultServerPort);

View File

@ -1,3 +1,18 @@
/*
* 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.client; package com.alibaba.nacos.client;
import org.junit.Test; import org.junit.Test;

View File

@ -1,3 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" <project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
@ -6,6 +19,7 @@
<groupId>com.alibaba.nacos</groupId> <groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId> <artifactId>nacos-all</artifactId>
<version>0.2.0-SM-SNAPSHOT</version> <version>0.2.0-SM-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -44,7 +44,7 @@ public class AppendLicense {
for (Iterator<File> iterator = targetFiles.iterator(); iterator.hasNext();) { for (Iterator<File> iterator = targetFiles.iterator(); iterator.hasNext();) {
File file = (File) iterator.next(); File file = (File) iterator.next();
List<String> srcFileContents = IOUtils.readLines(new FileInputStream(file), "utf-8"); List<String> srcFileContents = IOUtils.readLines(new FileInputStream(file), "utf-8");
List<String> writeContents = new ArrayList<>(); List<String> writeContents = new ArrayList<String>();
writeContents.addAll(licenseContents); writeContents.addAll(licenseContents);
writeContents.addAll(srcFileContents); writeContents.addAll(srcFileContents);
IOUtils.writeLines(writeContents, "\n", new FileOutputStream(file)); IOUtils.writeLines(writeContents, "\n", new FileOutputStream(file));

View File

@ -33,7 +33,7 @@ public class SystemUtil {
public static List<String> getIPsBySystemEnv(String key) { public static List<String> getIPsBySystemEnv(String key) {
String env = getSystemEnv(key); String env = getSystemEnv(key);
List<String> ips = new ArrayList<>(); List<String> ips = new ArrayList<String>();
if (StringUtils.isNotEmpty(env)) { if (StringUtils.isNotEmpty(env)) {
ips = Arrays.asList(env.split(",")); ips = Arrays.asList(env.split(","));
} }

View File

@ -1,3 +1,18 @@
/*
* 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.common.util; package com.alibaba.nacos.common.util;
import java.util.UUID; import java.util.UUID;

View File

@ -1,3 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
@ -128,6 +141,18 @@
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
<!-- <resources>
<resource>
<filtering>true</filtering>
<directory>src/main/resources</directory>
<excludes>
<exclude>application.properties</exclude>
<exclude>banner.txt</exclude>
<exclude>schema.sql</exclude>
<exclude>nacos-db.sql</exclude>
</excludes>
</resource>
</resources> -->
</build> </build>
<profiles> <profiles>
<profile> <profile>

View File

@ -48,8 +48,6 @@ public class Constants {
public static final String DAILY_DOMAINNAME = "commonconfig.taobao.net"; public static final String DAILY_DOMAINNAME = "commonconfig.taobao.net";
public static final int DEFAULT_PORT = 8080;
public static final String NULL = ""; public static final String NULL = "";
public static final String DATAID = "dataId"; public static final String DATAID = "dataId";

View File

@ -1,3 +1,18 @@
/*
* Copyright 1999-2018 Alibaba Group Holding Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alibaba.nacos.config.server.controller; package com.alibaba.nacos.config.server.controller;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;

View File

@ -0,0 +1,33 @@
package com.alibaba.nacos.config.server.model;
/**
* tenant info
* @author Nacos
*
*/
public class TenantInfo {
private String tenantId;
private String tenantName;
private String tenantDesc;
public String getTenantId() {
return tenantId;
}
public void setTenantId(String tenantId) {
this.tenantId = tenantId;
}
public String getTenantName() {
return tenantName;
}
public void setTenantName(String tenantName) {
this.tenantName = tenantName;
}
public String getTenantDesc() {
return tenantDesc;
}
public void setTenantDesc(String tenantDesc) {
this.tenantDesc = tenantDesc;
}
}

View File

@ -53,7 +53,6 @@ import org.springframework.transaction.TransactionSystemException;
import org.springframework.transaction.support.TransactionCallback; import org.springframework.transaction.support.TransactionCallback;
import org.springframework.transaction.support.TransactionTemplate; import org.springframework.transaction.support.TransactionTemplate;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import com.alibaba.nacos.config.server.model.ConfigAdvanceInfo; import com.alibaba.nacos.config.server.model.ConfigAdvanceInfo;
import com.alibaba.nacos.config.server.model.ConfigAllInfo; import com.alibaba.nacos.config.server.model.ConfigAllInfo;
import com.alibaba.nacos.config.server.model.ConfigHistoryInfo; import com.alibaba.nacos.config.server.model.ConfigHistoryInfo;
@ -66,6 +65,7 @@ import com.alibaba.nacos.config.server.model.ConfigInfoChanged;
import com.alibaba.nacos.config.server.model.ConfigKey; import com.alibaba.nacos.config.server.model.ConfigKey;
import com.alibaba.nacos.config.server.model.Page; import com.alibaba.nacos.config.server.model.Page;
import com.alibaba.nacos.config.server.model.SubInfo; import com.alibaba.nacos.config.server.model.SubInfo;
import com.alibaba.nacos.config.server.model.TenantInfo;
import com.alibaba.nacos.config.server.utils.LogUtil; import com.alibaba.nacos.config.server.utils.LogUtil;
import com.alibaba.nacos.config.server.utils.MD5; import com.alibaba.nacos.config.server.utils.MD5;
import com.alibaba.nacos.config.server.utils.PaginationHelper; import com.alibaba.nacos.config.server.utils.PaginationHelper;
@ -446,6 +446,15 @@ public class PersistService {
} }
}; };
static final class TenantInfoRowMapper implements RowMapper<TenantInfo> {
public TenantInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
TenantInfo info = new TenantInfo();
info.setTenantId(rs.getString("tenant_id"));
info.setTenantName(rs.getString("tenant_name"));
info.setTenantDesc(rs.getString("tenant_desc"));
return info;
}
}
public synchronized void reload() throws IOException { public synchronized void reload() throws IOException {
this.dataSourceService.reload(); this.dataSourceService.reload();
@ -2975,6 +2984,93 @@ public class PersistService {
} }
} }
/**
* insert tenant info
*
* @param kp
* kp
* @param tenantId
* tenant Id
* @param tenantName
* tenant name
* @param tenantDesc
* tenant description
* @param time time
*/
public void insertTenantInfoAtomic(String kp, String tenantId, String tenantName, String tenantDesc,
String createResoure, final long time) {
try {
jt.update(
"insert into tenant_info(kp,tenant_id,tenant_name,tenant_desc,create_source,gmt_create,gmt_modified) values(?,?,?,?,?,?,?)",
kp, tenantId, tenantName, tenantDesc, createResoure, time, time);
} catch (DataAccessException e) {
fatalLog.error("[db-error] " + e.toString(), e);
throw e;
}
}
/**
* Update tenantInfo showname
*
* @param kp
* kp
* @param tenantId
* tenant Id
* @param tenantName
* tenant name
* @param tenantDesc
* tenant description
*/
public void updateTenantNameAtomic(String kp, String tenantId, String tenantName, String tenantDesc) {
try {
jt.update(
"update tenant_info set tenant_name = ?, tenant_desc = ?, gmt_modified= ? where kp=? and tenant_id=?",
tenantName, tenantDesc, System.currentTimeMillis(), kp, tenantId);
} catch (DataAccessException e) {
fatalLog.error("[db-error] " + e.toString(), e);
throw e;
}
}
public List<TenantInfo> findTenantByKp(String kp) {
String sql = "select tenant_id,tenant_name,tenant_desc from tenant_info where kp=?";
try {
return this.jt.query(sql, new Object[] { kp }, TENANT_INFO_ROW_MAPPER);
} catch (CannotGetJdbcConnectionException e) {
fatalLog.error("[db-error] " + e.toString(), e);
throw e;
} catch (EmptyResultDataAccessException e) {
return Collections.emptyList();
} catch (Exception e) {
fatalLog.error("[db-other-error]" + e.getMessage(), e);
throw new RuntimeException(e);
}
}
public TenantInfo findTenantByKp(String kp, String tenantId) {
String sql = "select tenant_id,tenant_name,tenant_desc from tenant_info where kp=? and tenant_id=?";
try {
return this.jt.queryForObject(sql, new Object[] { kp, tenantId }, TENANT_INFO_ROW_MAPPER);
} catch (CannotGetJdbcConnectionException e) {
fatalLog.error("[db-error] " + e.toString(), e);
throw e;
} catch (EmptyResultDataAccessException e) {
return null;
} catch (Exception e) {
fatalLog.error("[db-other-error]" + e.getMessage(), e);
throw new RuntimeException(e);
}
}
public void removeTenantInfoAtomic(final String kp, final String tenantId) {
try {
jt.update("delete from tenant_info where kp=? and tenant_id=?", kp, tenantId);
} catch (CannotGetJdbcConnectionException e) {
fatalLog.error("[db-error] " + e.toString(), e);
throw e;
}
}
private List<ConfigInfo> convertDeletedConfig(List<Map<String, Object>> list) { private List<ConfigInfo> convertDeletedConfig(List<Map<String, Object>> list) {
List<ConfigInfo> configs = new ArrayList<ConfigInfo>(); List<ConfigInfo> configs = new ArrayList<ConfigInfo>();
for (Map<String, Object> map : list) { for (Map<String, Object> map : list) {
@ -3126,6 +3222,8 @@ public class PersistService {
return true; return true;
} }
static final TenantInfoRowMapper TENANT_INFO_ROW_MAPPER = new TenantInfoRowMapper();
static final ConfigInfoWrapperRowMapper CONFIG_INFO_WRAPPER_ROW_MAPPER = new ConfigInfoWrapperRowMapper(); static final ConfigInfoWrapperRowMapper CONFIG_INFO_WRAPPER_ROW_MAPPER = new ConfigInfoWrapperRowMapper();
static final ConfigKeyRowMapper CONFIG_KEY_ROW_MAPPER = new ConfigKeyRowMapper(); static final ConfigKeyRowMapper CONFIG_KEY_ROW_MAPPER = new ConfigKeyRowMapper();

View File

@ -77,7 +77,7 @@ public class ServerListService implements ApplicationListener<WebServerInitializ
@PostConstruct @PostConstruct
public void init() { public void init() {
serverPort = System.getProperty("nacos.server.port", "8080"); serverPort = System.getProperty("nacos.server.port", "8848");
String envDomainName = System.getenv("address_server_domain"); String envDomainName = System.getenv("address_server_domain");
if (StringUtils.isBlank(envDomainName)) { if (StringUtils.isBlank(envDomainName)) {
domainName = System.getProperty("address.server.domain", "jmenv.tbsite.net"); domainName = System.getProperty("address.server.domain", "jmenv.tbsite.net");

View File

@ -1,7 +1,7 @@
# spring # spring
management.security.enabled=false management.security.enabled=false
server.servlet.context-path=/nacos server.servlet.context-path=/nacos
server.port=8080 server.port=8848
db.num=2 db.num=2
db.url.0=url1 db.url.0=url1

View File

@ -4,10 +4,10 @@
<appender name="dumpFile" <appender name="dumpFile"
class="ch.qos.logback.core.rolling.RollingFileAppender"> class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${user.home}/nacos/logs/cfg-dump.log</file> <file>${user.home}/nacos/logs/config-dump.log</file>
<append>true</append> <append>true</append>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${user.home}/nacos/logs/cfg-dump.log.%d{yyyy-MM-dd}.%i</fileNamePattern> <fileNamePattern>${user.home}/nacos/logs/config-dump.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
<maxFileSize>2GB</maxFileSize> <maxFileSize>2GB</maxFileSize>
<MaxHistory>15</MaxHistory> <MaxHistory>15</MaxHistory>
<totalSizeCap>7GB</totalSizeCap> <totalSizeCap>7GB</totalSizeCap>
@ -20,10 +20,10 @@
</appender> </appender>
<appender name="pullFile" <appender name="pullFile"
class="ch.qos.logback.core.rolling.RollingFileAppender"> class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${user.home}/nacos/logs/cfg-pull.log</file> <file>${user.home}/nacos/logs/config-pull.log</file>
<append>true</append> <append>true</append>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${user.home}/nacos/logs/cfg-pull.log.%d{yyyy-MM-dd}.%i</fileNamePattern> <fileNamePattern>${user.home}/nacos/logs/config-pull.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
<maxFileSize>20MB</maxFileSize> <maxFileSize>20MB</maxFileSize>
<MaxHistory>15</MaxHistory> <MaxHistory>15</MaxHistory>
<totalSizeCap>128MB</totalSizeCap> <totalSizeCap>128MB</totalSizeCap>
@ -36,10 +36,10 @@
</appender> </appender>
<appender name="fatalFile" <appender name="fatalFile"
class="ch.qos.logback.core.rolling.RollingFileAppender"> class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${user.home}/nacos/logs/cfg-fatal.log</file> <file>${user.home}/nacos/logs/config-fatal.log</file>
<append>true</append> <append>true</append>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${user.home}/nacos/logs/cfg-fatal.log.%d{yyyy-MM-dd}.%i</fileNamePattern> <fileNamePattern>${user.home}/nacos/logs/config-fatal.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
<maxFileSize>20MB</maxFileSize> <maxFileSize>20MB</maxFileSize>
<MaxHistory>15</MaxHistory> <MaxHistory>15</MaxHistory>
<totalSizeCap>128MB</totalSizeCap> <totalSizeCap>128MB</totalSizeCap>
@ -52,10 +52,10 @@
</appender> </appender>
<appender name="memoryFile" <appender name="memoryFile"
class="ch.qos.logback.core.rolling.RollingFileAppender"> class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${user.home}/nacos/logs/cfg-memory.log</file> <file>${user.home}/nacos/logs/config-memory.log</file>
<append>true</append> <append>true</append>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${user.home}/nacos/logs/cfg-memory.log.%d{yyyy-MM-dd}.%i</fileNamePattern> <fileNamePattern>${user.home}/nacos/logs/config-memory.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
<maxFileSize>20MB</maxFileSize> <maxFileSize>20MB</maxFileSize>
<MaxHistory>15</MaxHistory> <MaxHistory>15</MaxHistory>
<totalSizeCap>128MB</totalSizeCap> <totalSizeCap>128MB</totalSizeCap>
@ -68,10 +68,10 @@
</appender> </appender>
<appender name="pullCheckFile" <appender name="pullCheckFile"
class="ch.qos.logback.core.rolling.RollingFileAppender"> class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${user.home}/nacos/logs/cfg-pull-check.log</file> <file>${user.home}/nacos/logs/config-pull-check.log</file>
<append>true</append> <append>true</append>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${user.home}/nacos/logs/cfg-pull-check.log.%d{yyyy-MM-dd}.%i</fileNamePattern> <fileNamePattern>${user.home}/nacos/logs/config-pull-check.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
<maxFileSize>1GB</maxFileSize> <maxFileSize>1GB</maxFileSize>
<MaxHistory>15</MaxHistory> <MaxHistory>15</MaxHistory>
<totalSizeCap>3GB</totalSizeCap> <totalSizeCap>3GB</totalSizeCap>
@ -85,10 +85,10 @@
<appender name="aclLog" <appender name="aclLog"
class="ch.qos.logback.core.rolling.RollingFileAppender"> class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${user.home}/nacos/logs/cfg-acl.log</file> <file>${user.home}/nacos/logs/config-acl.log</file>
<append>true</append> <append>true</append>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${user.home}/nacos/logs/cfg-acl.log.%d{yyyy-MM-dd}.%i</fileNamePattern> <fileNamePattern>${user.home}/nacos/logs/config-acl.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
<maxFileSize>50MB</maxFileSize> <maxFileSize>50MB</maxFileSize>
<MaxHistory>15</MaxHistory> <MaxHistory>15</MaxHistory>
<totalSizeCap>512MB</totalSizeCap> <totalSizeCap>512MB</totalSizeCap>
@ -102,10 +102,10 @@
<appender name="clientLog" <appender name="clientLog"
class="ch.qos.logback.core.rolling.RollingFileAppender"> class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${user.home}/nacos/logs/cfg-client-request.log</file> <file>${user.home}/nacos/logs/config-client-request.log</file>
<append>true</append> <append>true</append>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${user.home}/nacos/logs/cfg-client-request.log.%d{yyyy-MM-dd}.%i</fileNamePattern> <fileNamePattern>${user.home}/nacos/logs/config-client-request.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
<maxFileSize>2GB</maxFileSize> <maxFileSize>2GB</maxFileSize>
<MaxHistory>15</MaxHistory> <MaxHistory>15</MaxHistory>
<totalSizeCap>7GB</totalSizeCap> <totalSizeCap>7GB</totalSizeCap>
@ -119,10 +119,10 @@
<appender name="sdkLog" <appender name="sdkLog"
class="ch.qos.logback.core.rolling.RollingFileAppender"> class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${user.home}/nacos/logs/cfg-sdk-request.log</file> <file>${user.home}/nacos/logs/config-sdk-request.log</file>
<append>true</append> <append>true</append>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${user.home}/nacos/logs/cfg-sdk-request.log.%d{yyyy-MM-dd}.%i</fileNamePattern> <fileNamePattern>${user.home}/nacos/logs/config-sdk-request.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
<maxFileSize>1GB</maxFileSize> <maxFileSize>1GB</maxFileSize>
<MaxHistory>15</MaxHistory> <MaxHistory>15</MaxHistory>
<totalSizeCap>3GB</totalSizeCap> <totalSizeCap>3GB</totalSizeCap>
@ -136,10 +136,10 @@
<appender name="traceLog" <appender name="traceLog"
class="ch.qos.logback.core.rolling.RollingFileAppender"> class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${user.home}/nacos/logs/cfg-trace.log</file> <file>${user.home}/nacos/logs/config-trace.log</file>
<append>true</append> <append>true</append>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${user.home}/nacos/logs/cfg-trace.log.%d{yyyy-MM-dd}.%i</fileNamePattern> <fileNamePattern>${user.home}/nacos/logs/config-trace.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
<maxFileSize>2GB</maxFileSize> <maxFileSize>2GB</maxFileSize>
<MaxHistory>15</MaxHistory> <MaxHistory>15</MaxHistory>
<totalSizeCap>7GB</totalSizeCap> <totalSizeCap>7GB</totalSizeCap>
@ -153,10 +153,10 @@
<appender name="notifyLog" <appender name="notifyLog"
class="ch.qos.logback.core.rolling.RollingFileAppender"> class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${user.home}/nacos/logs/cfg-notify.log</file> <file>${user.home}/nacos/logs/config-notify.log</file>
<append>true</append> <append>true</append>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${user.home}/nacos/logs/cfg-notify.log.%d{yyyy-MM-dd}.%i</fileNamePattern> <fileNamePattern>${user.home}/nacos/logs/config-notify.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
<maxFileSize>1GB</maxFileSize> <maxFileSize>1GB</maxFileSize>
<MaxHistory>15</MaxHistory> <MaxHistory>15</MaxHistory>
<totalSizeCap>3GB</totalSizeCap> <totalSizeCap>3GB</totalSizeCap>
@ -170,10 +170,10 @@
<appender name="appCollectorLog" <appender name="appCollectorLog"
class="ch.qos.logback.core.rolling.RollingFileAppender"> class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${user.home}/nacos/logs/cfg-app.log</file> <file>${user.home}/nacos/logs/config-app.log</file>
<append>true</append> <append>true</append>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${user.home}/nacos/logs/cfg-app.log.%d{yyyy-MM-dd}.%i</fileNamePattern> <fileNamePattern>${user.home}/nacos/logs/config-app.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
<maxFileSize>20MB</maxFileSize> <maxFileSize>20MB</maxFileSize>
<MaxHistory>15</MaxHistory> <MaxHistory>15</MaxHistory>
<totalSizeCap>128MB</totalSizeCap> <totalSizeCap>128MB</totalSizeCap>
@ -187,10 +187,10 @@
<appender name="startLog" <appender name="startLog"
class="ch.qos.logback.core.rolling.RollingFileAppender"> class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${user.home}/nacos/logs/cfg-server.log</file> <file>${user.home}/nacos/logs/config-server.log</file>
<append>true</append> <append>true</append>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${user.home}/nacos/logs/cfg-server.log.%d{yyyy-MM-dd}.%i</fileNamePattern> <fileNamePattern>${user.home}/nacos/logs/config-server.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
<maxFileSize>50MB</maxFileSize> <maxFileSize>50MB</maxFileSize>
<MaxHistory>15</MaxHistory> <MaxHistory>15</MaxHistory>
<totalSizeCap>512MB</totalSizeCap> <totalSizeCap>512MB</totalSizeCap>

View File

@ -170,3 +170,18 @@ CREATE TABLE `tenant_capacity` (
UNIQUE KEY `uk_tenant_id` (`tenant_id`) UNIQUE KEY `uk_tenant_id` (`tenant_id`)
) ENGINE=InnoDB AUTO_INCREMENT=525 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='租户容量信息表' ) ENGINE=InnoDB AUTO_INCREMENT=525 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='租户容量信息表'
; ;
CREATE TABLE `tenant_info` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`kp` varchar(128) COLLATE utf8_bin NOT NULL COMMENT 'kp',
`tenant_id` varchar(128) COLLATE utf8_bin default '' COMMENT 'tenant_id',
`tenant_name` varchar(128) COLLATE utf8_bin default '' COMMENT 'tenant_name',
`tenant_desc` varchar(256) COLLATE utf8_bin DEFAULT NULL COMMENT 'tenant_desc',
`create_source` varchar(32) COLLATE utf8_bin DEFAULT NULL COMMENT 'create_source',
`gmt_create` bigint(20) NOT NULL COMMENT '创建时间',
`gmt_modified` bigint(20) NOT NULL COMMENT '修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_tenant_info_kptenantid` (`kp`,`tenant_id`),
KEY `idx_tenant_id` (`tenant_id`)
) ENGINE=InnoDB AUTO_INCREMENT=565666 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='tenant_info';

View File

@ -159,3 +159,17 @@ CREATE TABLE tenant_capacity (
constraint tenant_capacity_id_key PRIMARY KEY (id), constraint tenant_capacity_id_key PRIMARY KEY (id),
constraint uk_tenant_id UNIQUE (tenant_id)); constraint uk_tenant_id UNIQUE (tenant_id));
CREATE TABLE tenant_info (
id bigint NOT NULL generated by default as identity,
kp varchar(128) NOT NULL,
tenant_id varchar(128) DEFAULT '',
tenant_name varchar(128) DEFAULT '',
tenant_desc varchar(256) DEFAULT NULL,
create_source varchar(32) DEFAULT NULL,
gmt_create bigint NOT NULL,
gmt_modified bigint NOT NULL,
constraint tenant_info_id_key PRIMARY KEY (id),
constraint uk_tenant_info_kptenantid UNIQUE (kp,tenant_id));
CREATE INDEX tenant_info_tenant_id_idx ON tenant_info(tenant_id);

View File

@ -1,3 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" <project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
@ -6,6 +19,7 @@
<groupId>com.alibaba.nacos</groupId> <groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId> <artifactId>nacos-all</artifactId>
<version>0.2.0-SM-SNAPSHOT</version> <version>0.2.0-SM-SNAPSHOT</version>
</parent> </parent>
<artifactId>nacos-console</artifactId> <artifactId>nacos-console</artifactId>
<!--<packaging>war</packaging>--> <!--<packaging>war</packaging>-->
@ -67,5 +81,17 @@
</executions> </executions>
</plugin> </plugin>
</plugins> </plugins>
<!--<resources>-->
<!--<resource>-->
<!--<filtering>true</filtering>-->
<!--<directory>src/main/resources</directory>-->
<!--<excludes>-->
<!--<exclude>application.properties</exclude>-->
<!--<exclude>banner.txt</exclude>-->
<!--<exclude>diamond-server-logback.xml</exclude>-->
<!--<exclude>schema.sql</exclude>-->
<!--</excludes>-->
<!--</resource>-->
<!--</resources>-->
</build> </build>
</project> </project>

View File

@ -0,0 +1,169 @@
package com.alibaba.nacos.console.controller;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.alibaba.nacos.config.server.exception.NacosException;
import com.alibaba.nacos.config.server.model.RestResult;
import com.alibaba.nacos.config.server.model.TenantInfo;
import com.alibaba.nacos.config.server.service.PersistService;
import com.alibaba.nacos.config.server.utils.StringUtils;
import com.alibaba.nacos.console.model.Namespace;
import com.alibaba.nacos.console.model.NamespaceAllInfo;
/**
* namespace service
*
* @author Nacos
*
*/
@Controller
@RequestMapping("/v1/console/namespaces")
public class NamespaceController {
@Autowired
private transient PersistService persistService;
/**
* Get namespace list
*
* @param request
* request
* @param response
* response
* @return namespace list
*/
@ResponseBody
@RequestMapping(method = RequestMethod.GET)
public RestResult<List<Namespace>> getNamespaces(HttpServletRequest request, HttpServletResponse response) {
RestResult<List<Namespace>> rr = new RestResult<List<Namespace>>();
rr.setCode(200);
// TODO 获取用kp
List<TenantInfo> tenantInfos = persistService.findTenantByKp("1");
Namespace namespace0 = new Namespace("", "Public", 200, persistService.configInfoCount(""), 0);
List<Namespace> namespaces = new ArrayList<Namespace>();
namespaces.add(namespace0);
for (TenantInfo tenantInfo : tenantInfos) {
int configCount = persistService.configInfoCount(tenantInfo.getTenantId());
Namespace namespaceTmp = new Namespace(tenantInfo.getTenantId(), tenantInfo.getTenantName(), 200,
configCount, 2);
namespaces.add(namespaceTmp);
}
rr.setData(namespaces);
return rr;
}
/**
* get namespace all info by namespace id
*
* @param request
* request
* @param response
* response
* @param namespaceId
* namespaceId
* @return namespace all info
*/
@ResponseBody
@RequestMapping(params = "show=all", method = RequestMethod.GET)
public NamespaceAllInfo getNamespace(HttpServletRequest request, HttpServletResponse response,
@RequestParam("namespaceId") String namespaceId) {
// TODO 获取用kp
if (StringUtils.isBlank(namespaceId)) {
int configCount = persistService.configInfoCount();
NamespaceAllInfo namespaceTmp = new NamespaceAllInfo(namespaceId, "Public", 200, configCount, 0,
"Public Namespace");
return namespaceTmp;
} else {
TenantInfo tenantInfo = persistService.findTenantByKp("1", namespaceId);
int configCount = persistService.configInfoCount(namespaceId);
NamespaceAllInfo namespaceTmp = new NamespaceAllInfo(namespaceId, tenantInfo.getTenantName(), 200,
configCount, 2, tenantInfo.getTenantDesc());
return namespaceTmp;
}
}
/**
* create namespace
*
* @param request
* request
* @param response
* response
* @param namespaceName
* namespace Name
* @param namespaceDesc
* namespace Desc
* @return whether create ok
* @throws NacosException
*/
@RequestMapping(method = RequestMethod.POST)
@ResponseBody
public Boolean createNamespace(HttpServletRequest request, HttpServletResponse response,
@RequestParam("namespaceName") String namespaceName,
@RequestParam(value = "namespaceDesc", required = false) String namespaceDesc) throws NacosException {
// TODO 获取用kp
String namespaceId = UUID.randomUUID().toString();
persistService.insertTenantInfoAtomic("1", namespaceId, namespaceName, namespaceDesc, "nacos",
System.currentTimeMillis());
return true;
}
/**
* edit namespace
*
* @param request
* request
* @param response
* response
* @param namespace
* namespace
* @param namespaceShowName
* namespace ShowName
* @param namespaceDesc
* namespace Desc
* @return whether edit ok
* @throws NacosException
* NacosException
*/
@RequestMapping(method = RequestMethod.PUT)
@ResponseBody
public Boolean editNamespace(HttpServletRequest request, HttpServletResponse response,
@RequestParam("namespace") String namespace, @RequestParam("namespaceShowName") String namespaceShowName,
@RequestParam(value = "namespaceDesc", required = false) String namespaceDesc) throws NacosException {
// TODO 获取用kp
persistService.updateTenantNameAtomic("1", namespace, namespaceShowName, namespaceDesc);
return true;
}
/**
* del namespace by id
*
* @param request
* request
* @param response
* response
* @param namespaceId
* namespace Id
* @return whether del ok
* @throws NacosException
* NacosException
*/
@RequestMapping(method = RequestMethod.DELETE)
@ResponseBody
public Boolean deleteConfig(HttpServletRequest request, HttpServletResponse response,
@RequestParam("namespaceId") String namespaceId) throws NacosException {
persistService.removeTenantInfoAtomic("1", namespaceId);
return true;
}
}

View File

@ -0,0 +1,72 @@
package com.alibaba.nacos.console.model;
/**
* 命名空间
* @author diamond
*
*/
public class Namespace {
private String namespace;
private String namespaceShowName;
private int quota;
private int configCount;
/**
* 0 全局配置 1 默认私有命名空间 2 自定义命名空间
*/
private int type;
public String getNamespaceShowName() {
return namespaceShowName;
}
public void setNamespaceShowName(String namespaceShowName) {
this.namespaceShowName = namespaceShowName;
}
public String getNamespace() {
return namespace;
}
public void setNamespace(String namespace) {
this.namespace = namespace;
}
public Namespace() {
}
public Namespace(String namespace, String namespaceShowName) {
this.namespace = namespace;
this.namespaceShowName = namespaceShowName;
}
public Namespace(String namespace, String namespaceShowName, int quota, int configCount, int type) {
this.namespace = namespace;
this.namespaceShowName = namespaceShowName;
this.quota = quota;
this.configCount = configCount;
this.type = type;
}
public int getQuota() {
return quota;
}
public void setQuota(int quota) {
this.quota = quota;
}
public int getConfigCount() {
return configCount;
}
public void setConfigCount(int configCount) {
this.configCount = configCount;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
}

View File

@ -0,0 +1,29 @@
package com.alibaba.nacos.console.model;
/**
* all namespace info
* @author Nacos
*
*/
public class NamespaceAllInfo extends Namespace {
private String namespaceDesc;
public String getNamespaceDesc() {
return namespaceDesc;
}
public void setNamespaceDesc(String namespaceDesc) {
this.namespaceDesc = namespaceDesc;
}
public NamespaceAllInfo() {
};
public NamespaceAllInfo(String namespace, String namespaceShowName, int quota, int configCount, int type,
String namespaceDesc) {
super(namespace, namespaceShowName, quota, configCount, type);
this.namespaceDesc = namespaceDesc;
}
}

View File

@ -2,7 +2,7 @@
management.security.enabled=false management.security.enabled=false
server.contextPath=/nacos server.contextPath=/nacos
server.servlet.contextPath=/nacos server.servlet.contextPath=/nacos
server.port=8080 server.port=8848
spring.mvc.view.prefix=/jsp/ spring.mvc.view.prefix=/jsp/
# 响应页面默认后缀 # 响应页面默认后缀
spring.mvc.view.suffix=.jsp spring.mvc.view.suffix=.jsp

View File

@ -159,3 +159,15 @@ CREATE TABLE tenant_capacity (
constraint tenant_capacity_id_key PRIMARY KEY (id), constraint tenant_capacity_id_key PRIMARY KEY (id),
constraint uk_tenant_id UNIQUE (tenant_id)); constraint uk_tenant_id UNIQUE (tenant_id));
CREATE TABLE tenant_info (
id bigint NOT NULL generated by default as identity,
kp varchar(128) NOT NULL,
tenant_id varchar(128) DEFAULT '',
tenant_name varchar(128) DEFAULT '',
tenant_desc varchar(256) DEFAULT NULL,
create_source varchar(32) DEFAULT NULL,
gmt_create bigint NOT NULL,
gmt_modified bigint NOT NULL,
constraint tenant_info_id_key PRIMARY KEY (id),
constraint uk_tenant_info_kptenantid UNIQUE (kp,tenant_id));
CREATE INDEX tenant_info_tenant_id_idx ON tenant_info(tenant_id);

View File

@ -0,0 +1,12 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
# production
/dist
/build
# misc
.DS_Store
npm-debug.log*

View File

@ -0,0 +1,14 @@
{
"disableCSSModules": true,
"outputPath": "./build",
"proxy": {
"/": {
"target": "http://127.0.0.1:8848", //这边写你自己的服务Ip
"changeOrigin": true,
"pathRewrite": { "^/" : "" }
}
},
"extraBabelPlugins": [
"transform-decorators-legacy"
]
}

View File

@ -0,0 +1,53 @@
# 开始项目
## cnpm 安装(可忽略)
```sh
npm install -g cnpm --registry=https://registry.npm.taobao.org
# 设置匿名
alias cnpm="npm --registry=https://registry.npm.taobao.org \
--cache=$HOME/.npm/.cache/cnpm \
--disturl=https://npm.taobao.org/dist \
--userconfig=$HOME/.cnpmrc"
# Or alias it in .bashrc or .zshrc
$ echo '\n#alias for cnpm\nalias cnpm="npm --registry=https://registry.npm.taobao.org \
--cache=$HOME/.npm/.cache/cnpm \
--disturl=https://npm.taobao.org/dist \
--userconfig=$HOME/.cnpmrc"' >> ~/.zshrc && source ~/.zshrc
```
[详情地址: http://npm.taobao.org/](http://npm.taobao.org/)
## 安装依赖
```sh
cnpm install
```
## 启动
```sh
npm start
```
## 构建打包
```sh
npm run build
```
##
# 代理配置
根目录下的 .webpackrc
修改proxy属性
```
"proxy": {
"/": {
"target": "http://ip:port/", //这边写你自己的服务Ip
"changeOrigin": true,
"pathRewrite": { "^/" : "" }
}
},
```
# dva api
[https://github.com/dvajs/dva/blob/master/docs/api/README.md](https://github.com/dvajs/dva/blob/master/docs/api/README.md)

View File

@ -0,0 +1,30 @@
const cp = require('child_process');
const fs = require('fs');
const path = require('path');
// 默认打包存放地址
const buildDir = 'build';
// 打包后文件存放地址
const targetDir = __dirname;
const spawnAsync = (...args) => new Promise((resolve, reject) => {
const worker = cp.spawn(...args, { stdio: 'inherit' });
worker.on('close', resolve);
worker.on('error', reject);
});
spawnAsync('roadhog', ['build'])
.then(() => {
const _buildDir = path.join(__dirname, buildDir);
if (!fs.statSync(_buildDir).isDirectory()) {
return;
}
let fileList = fs.readdirSync(_buildDir, "utf8");
fileList.forEach((fileName) => {
if (fileName === "." || fileName === "..") {
return;
}
const _buildPath = path.join(buildDir, fileName);
const _targetPath = path.join(targetDir, fileName);
fs.writeFileSync(_targetPath, fs.readFileSync(_buildPath, "utf8"), "utf8");
})
});

View File

@ -0,0 +1,3 @@
#!/bin/bash
npm run build
cp ./build/* ./

View File

@ -0,0 +1,951 @@
window.i18ndoc = {
"zh-cn": {
"com.alibaba.nacos.layout.noenv.nacosversion":"1.0",
"nacos.component.ExportDialog.tags2": "标签:",
"historyRollback": "历史版本",
"com.alibaba.nacos.component.MiddleWareEnv.Spas_dedicated": "Spas专用",
"com.alibaba.nacos.page.pushTrajectory.track": "条轨迹。",
"com.alibaba.nacos.component.NameSpaceList.Prompt": "提示",
"nacos.page.namespace.namespace_ID": "命名空间ID:",
"com.alibaba.nacos.page.historyrollback.query": "查询",
"com.alibaba.nacos.page.configdetail.configuration_details": "配置详情",
"com.alibaba.nacos.component.AddGroup.a_new_group": "新建Group",
"com.alibaba.nacos.component.DiffEditorDialog.contents": "内容比较",
"namespace": "命名空间",
"com.alibaba.nacos.page.historyRollback.queryresult": "查询结果:共查询到",
"com.alibaba.nacos.page.pushTrajectory.determine": "查询",
"com.alibaba.nacos.component.NameSpaceList.online_customer_support": "在线客服支持:",
"com.alibaba.nacos.page.historyRollback.dataid": "请输入Data ID",
"nacos.page.configurationManagement.Please_enter_tag": "请输入标签",
"nacos.page.namespace.namespace_number": "命名空间ID",
"nacos.component.NameSpaceList.Announcement_nodejs_version_is_developed,supports_a_custom_message": "公告Node.js版上线。支持定制消息。",
"com.alibaba.nacos.page.configRollback.retracted": "收起",
"com.alibaba.nacos.component.NewDatePicker.to_cancel_the": "确定",
"com.alibaba.nacos.component.MiddleWareEnv.daily_units": "日常单元",
"nacos.page.configdetail.Open0": "开",
"com.alibaba.nacos.page.configeditor.vdchart": "请勿输入非法字符",
"com.alibaba.nacos.component.EditorNameSpace.prompt": "提示",
"com.alibaba.nacos.component.DiffEditorDialog.confirm_that_the": "确认发布",
"com.alibaba.nacos.component.NewDatePicker.": "最近",
"com.alibaba.nacos.pubshow": "子账号没有权限请联系主账号负责人RAM上授权",
"com.alibaba.nacos.page.configeditor.Home_application:": "Group不能为空",
"nacos.page.configdetail.Tags": "标签:",
"com.alibaba.nacos.page.configurationManagement.configuration_management": "配置列表",
"nacos.page.configurationManagement.Tags": "标签:",
"com.alibaba.nacos.page.newconfig.new_listing": "新建配置",
"com.alibaba.nacos.page.configsync.target": "目标地域:",
"nacos.component.ExportDialog.configuration_number6": "配置数量:",
"nacos.component.validateDialog.title": "账号安全验证",
"nacos.page.configurationManagement.,_wherein": ",其中",
"com.alibaba.nacos.component.MiddleWareEnv.switch_environment": "切换环境",
"com.alibaba.nacos.page.configsync.return": "返回",
"newconfig": "新建配置",
"com.alibaba.nacos.page.configeditor.": "返回",
"com.alibaba.nacos.page.configsync.sync": "同步",
"com.alibaba.nacos.component.NewDatePicker.24_hours": "24小时",
"com.alibaba.nacos.page.listAllEnvironmental.environment_name": "环境名称",
"nacos.component.ShowCodeing.package_com.alibaba.cloud.acm.sample;import_org.springframework.bea": "package com.alibaba.cloud.acm.sample;import org.springframework.beans.factory.annotation.Value;import org.springframework.boot.ApplicationArguments;import org.springframework.boot.ApplicationRunner;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;import org.springframework.cloud.context.config.annotation.RefreshScope;import org.springframework.stereotype.Component;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RestController;/** * Created on 01/10/2017. * 假设用户配置内容为 * user.id = 0 * user.name = juven.xxxb * user.age = 18 * @author juven.xuxb */@SpringBootApplicationpublic class SampleApplication { public static void main(String[] args) { SpringApplication.run(SampleApplication.class, args); }}@Componentclass SampleRunner implements ApplicationRunner { @Value(\"${user.id}\") String userId; @Value(\"${user.name}\") String userName; @Value(\"${user.age}\") int userAge; public void run(ApplicationArguments args) throws Exception { System.out.println(userId); System.out.println(userName); System.out.println(userAge); }}@RestController@RequestMapping(\"/sample\")@RefreshScopeclass SampleController { @Value(\"${user.name}\") String userName; @RequestMapping(\"/acm\") public String simple() { return \"Hello Spring Cloud ACM!\" \"Hello \" userName \"!\"; }}",
"nacos.component.validateDialog.Click_to_get_verification_code": "点击获取验证码",
"com.alibaba.nacos.page.consistencyEfficacy.environment_marked": "环境标示",
"com.alibaba.nacos.component.NameSpaceList.Announcement_nodejs_version_is_developed,supports_a_custom_message": "公告Node.js版上线,支持定制消息。",
"nacos.page.configurationManagement.process_is_successful,_the_cloned": "处理成功,克隆了",
"com.alibaba.nacos.page.configurationManagement.the_sample_code": "示例代码",
"nacos.component.CloneDialog.|_the_selected_entry4": "| 选中的条目",
"confirm": "确定",
"com.alibaba.nacos.page.configRollback.delete": "删除",
"com.alibaba.nacos.page.configsync.belongs_to_the_environment": "所属地域:",
"com.alibaba.nacos.component.ShowCodeing.loading": "加载中...",
"nacos.page.configurationManagement.import_failed": "导入失败",
"com.alibaba.nacos.page.configurationManagement.clickfordetail": "点击了解SDK详细示例",
"nacos.page.configurationManagement.configuration_management8": "配置管理",
"com.alibaba.nacos.page.consistencyEfficacy.operation": "操作",
"com.alibaba.nacos.page.environmentalManagement.view_environment_IP": "查看环境IP",
"com.alibaba.nacos.page.configeditor.configuration_formatpre": "默认不要勾选。",
"nacos.page.configurationManagement.Delete_failed": "删除失败",
"com.alibaba.nacos.page.environmentalManagement.environment_ip": "环境IP",
"com.alibaba.nacos.page.newconfig.Data_ID_length": "收起",
"nacos.page.configdetail.Data_encryption0": "数据加密",
"nacos.component.CloneDialog.get_the_namespace_failed": "获取命名空间失败",
"nacos.component.ImportDialog.Upload_File3": "上传文件",
"com.alibaba.nacos.page.configdetail.home": "归属应用:",
"com.alibaba.nacos.page.environmentalManagement.view": "查看",
"nacos.page.configurationManagement.configuration_item?": "条配置项?",
"com.alibaba.nacos.page.environmentalManagement.environment_name": "环境名称",
"nacos.page.namespace.AccessKey_recommended0": "AccessKey推荐:",
"nacos.component.validateDialog.remark": "提示: 验证码会通过短信发送到您绑定的手机号。",
"com.alibaba.nacos.page.consistencyEfficacy.reset": "重置",
"com.alibaba.nacos.page.newconfig.group_placeholder": "请输入Group名称",
"com.alibaba.nacos.page.configdetail.belongs_to_the_environment": "地域:",
"com.alibaba.nacos.page.listeningToQuery.failure": "失败",
"hanxie.show": "测试",
"com.alibaba.nacos.page.newconfig.esc_exit": "发布",
"pubnodata": "没有数据",
"nacos.page.configurationManagement.ACM_dedicated_AccessKey_will_the_waste,_does_not_recommend_t": "ACM专用AccessKey即将废弃不建议使用:",
"com.alibaba.nacos.page.newconfig.configuration_format": "配置内容:",
"configurationManagement": "配置列表",
"nacos.component.ShowCodeing.,_6000);_System.out.println(content);_//_初始化的时候给配置添加监听,配置变更会回调通知_C": "\", 6000);\t\t\tSystem.out.println(content);\t\t\t// 初始化的时候,给配置添加监听,配置变更会回调通知\t\t\tConfigService.addListener(\"",
"com.alibaba.nacos.component.NewDatePicker.custom": "时间范围不能超过45天",
"com.alibaba.nacos.page.historyDetail.recipient_from": "收起",
"com.alibaba.nacos.page.configdetail.recipient_from": "收起",
"nacos.component.validateDialog.Please_fill_out_the_verification_code": "输入验证码:",
"nacos.page.newconfig.Note_You_are_to_be_a_custom_packet_the_new_configuration,_make_sure_that_the_client_use_the_Pandora_version_higher_than_3._4._0,_otherwise_it_may_read_less_than_the_configuration.0": "注您正在往一个自定义分组新增配置请确保客户端使用的Pandora版本高于3.4.0,否则可能读取不到该配置。",
"com.alibaba.nacos.page.listeningToQuery.please_input_group": "请输入Group",
"com.alibaba.nacos.component.NewDatePicker.7_day": "7天",
"nacos.component.ShowCodeing.-Dproject.name=acmtest_-Dspas.identity=CUserswater.lyl.spas_keyacmt": "-Dproject.name=acmtest -Dspas.identity=C:Userswater.lyl.spas_keyacmtest\t\t\t * 在本地的acmtest文件中填写accessKey/secretKey,格式如下\t\t\t * accessKey=",
"nacos.component.DeleteDialog.deletetitle": "删除配置",
"com.alibaba.nacos.page.pushTrajectory.Push_the_trajectory": "推送轨迹",
"com.alibaba.nacos.page.configeditor.release": "发布Beta",
"com.alibaba.nacos.page.configeditor.Esc_exit": "按F1显示全屏",
"com.alibaba.nacos.page.configsync.home": "归属应用:",
"minute": "分钟",
"com.alibaba.nacos.layout.noenv.app_configuration_management_ACM": "NACOS",
"com.alibaba.nacos.page.configRollback.home": "归属应用:",
"nacos.page.configurationManagement.no_longer_display4": "不再显示:",
"nacos.page.configurationManagement.open_Bulletin_Board7": "打开公告栏",
"nacos.page.configurationManagement.SecretKey_recommended4": "SecretKey推荐:",
"com.alibaba.nacos.page.pushTrajectory.configget": "配置推送 or 主动获取",
"com.alibaba.nacos.page.configRollback.action_type": "操作类型:",
"nacos.component.CloneDialog.target_space": "目标空间:",
"com.alibaba.nacos.component.DiffEditorDialog.original_value": "原始值",
"com.alibaba.nacos.page.configurationManagement.environment": "地域:",
"nacos.page.configdetail.Description": "描述:",
"com.alibaba.nacos.page.pushTrajectory.Data_Id_can_not_be_empty": "Data ID不能为空",
"com.alibaba.nacos.page.listAllEnvironmental.Into_the": "进入",
"com.alibaba.nacos.page.listeningToQuery._Push_state": "推送状态",
"nacos.component.CloneDialog.configuration_cloning": "配置克隆(",
"com.alibaba.nacos.page.configurationManagement.new_listing": "新建配置",
"nacos.component.ExportDialog.source_space5": "源空间:",
"nacos.component.ShowCodeing.*///_ConfigService.init();_//_主动获取配置_String_content_=_ConfigService.getConfig(": "*///\t\t\tConfigService.init();\t\t\t\t\t\t// 主动获取配置\t\t\tString content = ConfigService.getConfig(\"",
"cancel": "取消",
"com.alibaba.nacos.component.MiddleWareEnv.online": "线上",
"com.alibaba.nacos.page.historyRollback.rollback": "回滚",
"com.alibaba.nacos.page.historyRollback.last_update_time": "最后更新时间",
"com.alibaba.nacos.page.pushTrajectory.please_enter": "请输入查询IP",
"com.alibaba.nacos.page.historyDetail.configure_content": "配置内容:",
"com.alibaba.nacos.page.consistencyEfficacy.environment_name": "环境名",
"nacos.component.ShowCodeing.-Dproject.name=acmtest_-Dspas.identity=CUserswater.lyl.spas_keyacmtest_*_在本地的acmtest文件中填写accessKey/secretKey,格式如下_*_accessKey=": "-Dproject.name=acmtest -Dspas.identity=C:Userswater.lyl.spas_keyacmtest\t\t\t * 在本地的acmtest文件中填写accessKey/secretKey,格式如下\t\t\t * accessKey=",
"nacos.page.configurationManagement.configuration_export9": "配置导出",
"nacos.page.namespace.note_ACM_is_dedicated_AK/SK_is_mainly_used_for_some_of_the_compatibility_scenario,_it_is_recommended_to_Unified_the_use_of_Ali_cloud_AK/SK.5": "注ACM专用AK/SK主要用于一些兼容性场景。建议统一采用阿里云AK/SK。",
"com.alibaba.nacos.page.namespace.add": "新建命名空间",
"com.alibaba.nacos.page.configsync.sync_configuration_main": "同步配置",
"nacos.page.configeditor.Tags": "标签:",
"dateinfo1": "结束时间必须大于开始时间",
"com.alibaba.nacos.service.fill_the_code": "请填写验证码",
"nacos.page.newconfig.Description": "描述:",
"nacos.component.ImportDialog.target_space5": "目标空间:",
"configsync": "同步配置",
"nacos.component.CloneDialog.skip": "跳过",
"com.alibaba.nacos.page.configurationManagement.click_to_learn_Group": "点击了解Group",
"com.alibaba.nacos.page.newconfig.the_more_advanced": "Group不能为空",
"nacos.page.namespace.ACM_special_SecretKey_will_be_abandoned,_not_recommended_for_use4": "ACM专用SecretKey即将废弃不建议使用:",
"com.alibaba.nacos.page.namespace.public": "public(保留控件)",
"com.alibaba.nacos.page.configsync.error": "错误",
"nacos.page.namespace.AccessKey_recommended1": "AccessKey开发环境推荐:",
"com.alibaba.nacos.page.pushTrajectory.configuration": "配置",
"com.alibaba.nacos.page.configeditor.toedit": "编辑配置",
"com.alibaba.nacos.component.NewDatePicker.12_hours": "12小时",
"com.alibaba.nacos.page.configsync.for_more_advanced_options": "更多高级选项",
"nacos.page.configurationManagement.AccessKey_recommended3": "AccessKey开发环境推荐:",
"nacos.page.configurationManagement.note_ACM_is_dedicated_AK/SK_is_mainly_used_for_some_of_the_c": "注ACM 专用AK/SK主要用于一些兼容性场景推荐您统一采用阿里云AK/SK。",
"com.alibaba.nacos.page.newconfig.the_home_application": "目标地域:",
"com.alibaba.nacos.page.configeditor.official": "正式",
"nacos.component.validateDialog.phoneNumber": "手机号码:",
"nacos.page.namespace.SecretKey_recommended2": "SecretKey推荐:",
"com.alibaba.nacos.page.namespace.delete": "删除",
"com.alibaba.nacos.component.NewDatePicker.60_-_": "60分钟",
"com.alibaba.nacos.page.configsync.retracted": "收起",
"nacos.page.configdetail.off1": "关",
"com.alibaba.nacos.page.historyDetail.delete": "删除",
"nacos.page.configurationManagement.items_for": "项为",
"nacos.component.CloneDialog.the_same_configuration": "相同配置:",
"com.alibaba.nacos.component.NewNameSpace.name": "命名空间名:",
"com.alibaba.nacos.component.MiddleWareEnv.line": "线上/",
"nacos.page.configurationManagement.batch_management": "批量管理",
"com.alibaba.nacos.page.configeditor.configure_contents_of": "配置格式:",
"com.alibaba.nacos.component.NewNameSpace.loading": "加载中...",
"com.alibaba.nacos.component.MiddleWareEnv.maletest": "阳中测试",
"nacos.page.configurationManagement.clone": "克隆",
"nacos.page.configurationManagement.a_ACM_front-end_monitoring_questionnaire,_the_time_limit_to_": "答 ACM 前端监控调查问卷,限时领取阿里云代金券\t 详情猛戳:",
"nacos.page.configurationManagement.HOME_Application": "归属应用:",
"com.alibaba.nacos.page.newconfig.publish_failed": "发布失败。请检查参数是否正确。",
"com.alibaba.nacos.page.historyDetail.belongs_to_the_environment": "所属地域:",
"com.alibaba.nacos.page.configRollback.configuration_rollback": "配置回滚",
"com.alibaba.nacos.page.configurationManagement.edit": "编辑",
"nacos.component.ImportDialog.skip1": "跳过",
"com.alibaba.nacos.page.pushTrajectory.Group_Id_cannot_be_empty": "Group不能为空",
"nacos.page.configurationManagement.successful_entry": "成功的条目:",
"com.alibaba.nacos.component.NewNameSpace.cancel": "取消",
"nacos.page.newconfig.Open0": "开",
"com.alibaba.nacos.page.configRollback.environment": "地域:",
"com.alibaba.nacos.page.pushTrajectory.The_new_configuration_value_persistent": "新配置值持久化",
"nacos.component.CloneDialog.tags": "标签:",
"com.alibaba.nacos.page.pushTrajectory.interval:": "时间区间:",
"nacos.component.DeleteDialog.determine": "确定",
"nacos.component.validateDialog.verification_code_error": "验证码错误",
"com.alibaba.nacos.page.configdetail.return": "返回",
"com.alibaba.nacos.page.listAllEnvironmental.operation": "操作",
"com.alibaba.nacos.page.newconfig.stop_fails": "停止Beta发布失败。",
"com.alibaba.nacos.component.EditorNameSpace.confirm_modify": "编辑命名空间",
"com.alibaba.nacos.component.EditorNameSpace.namespace": "命名空间不能为空",
"nacos.page.namespace.note_ACM_is_dedicated_AK/SK_is_mainly_used_for_some_of_the_compatibility_s": "注ACM 专用AK/SK主要用于一些兼容性场景推荐您统一采用阿里云AK/SK。",
"com.alibaba.nacos.component.MiddleWareEnv.daily_stable": "日常稳定",
"com.alibaba.nacos.page.pushTrajectory.used": "新配置生效",
"com.alibaba.nacos.page.configRollback.determine": "确定要",
"nacos.component.NameSpaceList.Quick_to_learn0": "学习路径",
"nacos.page.namespace.click_on_the_obtain_of1": "点击获取 》",
"com.alibaba.nacos.page.newconfig": "Data ID 不能为空",
"nacos.page.configurationManagement.export_check_failed": "导出检查失败",
"nacos.component.ImportDialog.file_upload_directly_after_importing_the_configuration,_please_be_sure_to_exercise_caution7": "文件上传后将直接导入配置,请务必谨慎操作",
"com.alibaba.nacos.page.namespace.prompt": "提示",
"nacos.page.namespace.sure_you_want_to_delete_the_following_namespaces?": "确定要删除以下命名空间吗?",
"nacos.component.validateDialog.confirm": "确定",
"nacos.page.configurationManagement.please_input_the_application_name": "请输入应用名",
"nacos.page.configurationManagement.please_select_the_required_delete_the_configuration_item": "请选择需要删除的配置项",
"com.alibaba.nacos.component.MiddleWareEnv.international": "国际化",
"com.alibaba.nacos.component.NewDatePicker.to": "查询范围:",
"com.alibaba.nacos.page.configeditor.recipient_from": "Data ID不能为空",
"nacos.page.configurationManagement.whether_to_delete_the_selected": "是否删除已选择的",
"com.alibaba.nacos.component.MiddleWareEnv.daily_environment_packet": "日常环境分组",
"com.alibaba.nacos.page.configeditor.toedittitle": "编辑配置",
"nacos.page.configeditor.Description": "描述:",
"day": "天",
"com.alibaba.nacos.page.listAllEnvironmental.view_environment_IP": "查看环境IP",
"com.alibaba.nacos.page.configurationManagement.delete": "删除",
"cspupcloud.page.historyRollback.Retained_for_30_days": "保留30天",
"com.alibaba.nacos.page.configeditor.beta_release:": "目标地域:",
"nacos.page.pushTrajectory.Please_enter_the_user_IP0": "请输入用户IP",
"com.alibaba.nacos.component.NewNameSpace.confirm": "确定",
"nacos.component.DeleteDialog.deleted_successfully_configured": "删除配置成功",
"nacos.component.ShowCodeing.,_new_PropertiesListener()_{_@Override_public_void_innerReceive(Pro": "\", new PropertiesListener() {\t\t\t\t\t\t\t\t@Override\t\t\t\tpublic void innerReceive(Properties properties) {\t\t\t\t\t// TODO Auto-generated method stub\t\t\t\t\tacmProperties = properties;\t\t\t\t\tSystem.out.println(properties);\t\t\t\t}\t\t\t});\t\t\t\t\t\t**/\t\t\t\t\t} catch (ConfigException e) {\t\t\te.printStackTrace();\t\t}\t\t// 测试让主线程不退出,因为订阅配置是守护线程,主线程退出守护线程就会退出。 正式代码中无需下面代码\t\twhile (true) {\t\t\ttry {\t\t\t\tThread.sleep(1000);\t\t\t} catch (InterruptedException e) {\t\t\t\te.printStackTrace();\t\t\t}\t\t}\t}\t // 通过get接口把配置值暴露出去使用 public static String getConfig() { return config; } \t// 通过get接口把配置值暴露出去使用\tpublic static Object getPorpertiesValue(String key) {\t\tif (acmProperties != null) {\t\t\treturn acmProperties.get(key);\t\t}\t\treturn null;\t}}",
"com.alibaba.nacos.page.namespace.operation": "操作",
"com.alibaba.nacos.page.configurationManagement.push_track": "推送轨迹",
"nacos.page.namespace.region_ID": "地域ID",
"com.alibaba.nacos.component.NewNameSpace.norepeat": "命名空间名称不能重复",
"com.alibaba.nacos.page.configRollback.inserted": "插入",
"com.alibaba.nacos.page.configurationManagement.version": "历史版本",
"com.alibaba.nacos.page.configRollback.rollback": "回滚",
"nacos.page.namespace.delete_failed": "删除失败",
"com.alibaba.nacos.component.SuccessDialog.determine": "确定",
"nacos.page.configurationManagement.HOME_Application0": "归属应用:",
"to": "至",
"com.alibaba.nacos.page.environmentalManagement.operation": "操作",
"nacos.page.namespace.ACM_dedicated_AccessKey_will_the_waste,_does_not_recommend_the_use_of3": "ACM专用AccessKey即将废弃不建议使用:",
"com.alibaba.nacos.page.configurationManagement.configuration_query": "配置查询",
"nacos.component.validateDialog.fill_the_code": "请填写验证码",
"nacos.page.configurationManagement.Please_enter_the_name_of_the_app1": "请输入应用名",
"com.alibaba.nacos.page.newconfig.collapse": "更多高级选项",
"com.alibaba.nacos.page.namespace.edit": "编辑",
"nacos.page.namespace._Details_of6": "详情 》",
"com.alibaba.nacos.component.ShowCodeing.Sample_code": "示例代码",
"nacos.component.ImportDialog.Import_configuration4": "导入配置 ( ",
"nacos.page.configurationManagement.please_choose_the_required_export_configuration_items10": "请选择需要导出的配置项",
"com.alibaba.nacos.page.configdetail.beta_release": "Beta发布",
"com.alibaba.nacos.page.configurationManagement.fuzzyd": "模糊查询请输入Data ID",
"com.alibaba.nacos.page.newconfig.group_is_not_empty": "Group ID长度不能超过127字符",
"com.alibaba.nacos.component.EditorNameSpace.private": "公共空间",
"com.alibaba.nacos.page.environmentalManagement.all_available_environment": "所有可用环境",
"dateinfo2": "时间范围不能超过45天",
"nacos.page.namespace.Namespace_details": "命名空间详情",
"nacos.component.ImportDialog.the_same_configuration6": "相同配置:",
"nacos.page.newconfig.Tags": "标签:",
"nacos.page.configurationManagement.Configuration_cloning0": "配置克隆",
"com.alibaba.nacos.component.NewDatePicker.4_hours": "4小时",
"com.alibaba.nacos.page.configeditor.group_is_not_empty": "更多高级选项",
"nacos.page.configurationManagement.SecretKey_recommended5": "SecretKey开发环境推荐:",
"com.alibaba.nacos.page.configurationManagement.click_to_learn_DataId": "点击了解Data ID",
"nacos.page.configurationManagement.ACM_special_SecretKey_will_be_abandoned,_not_recommended_for": "ACM专用SecretKey即将废弃不建议使用:",
"com.alibaba.nacos.page.configsync.sync_configuration": "同步配置成功",
"com.alibaba.nacos.component.MiddleWareEnv.new_diamond": "新版Diamond",
"com.alibaba.nacos.page.newconfig.release": "返回",
"com.alibaba.nacos.page.configeditor.wrong": "错误",
"com.alibaba.nacos.page.pushTrajectory.user_IP": "用户IP",
"nacos.page.configeditor.Data_encryption0": "数据加密",
"com.alibaba.nacos.page.historyDetail.update": "更新",
"historyDetail": "历史详情",
"nacos.page.configurationManagement.select_need_to_clone_the_configuration_items1": "请选择需要克隆的配置项",
"nacos.page.configurationManagement._Details_of8": "详情 》",
"nacos.page.configurationManagement.Batch_processing0": "批量处理",
"com.alibaba.nacos.page.pushTrajectory.query_dimension": "查询维度:",
"nacos.component.NameSpaceList.Announcement_nodejs_version_is_developed,supports_a_custom_messag": "公告Node.JS版上线。支持定制消息。",
"nacos.component.ShowCodeing.package_com.alibaba.middleware.acm;import_java.util.Properties;impo": "package com.alibaba.middleware.acm;import java.util.Properties;import com.alibaba.edas.acm.ConfigService;import com.alibaba.edas.acm.exception.ConfigException;import com.alibaba.edas.acm.listener.ConfigChangeListener;import com.alibaba.edas.acm.listener.PropertiesListener;// 示例代码仅用于示例测试public class ACMTest { // 属性/开关 private static String config = \"DefaultValue\";\t private static Properties acmProperties = new Properties(); \tpublic static void main(String[] args) {\t\ttry {\t\t\t\t\t\t// 本地调试模式。本机测试无法连接ACM服务集群因此设置debug模式该模式下获取值为null不会进入回调函数。\t\t\t// ConfigService.setDebug(true);\t\t\t\t\t\t// 初始化配置服务,控制台通过示例代码自动获取下面参数\t\t\tConfigService.init(\"",
"com.alibaba.nacos.component.NewDatePicker.3_day": "3天",
"custom": "自定义",
"com.alibaba.nacos.component.MiddleWareEnv.daily_test_center": "日常测试中心",
"com.alibaba.nacos.page.configRollback.for_more_advanced": "更多高级选项",
"nacos.component.CloneDialog.Terminate_the_clone0": "终止克隆",
"com.alibaba.nacos.page.configurationManagement.operation": "操作",
"com.alibaba.nacos.layout.noenv.Click_to_learn_the_namespace": "点击了解命名空间",
"com.alibaba.nacos.page.configeditor.look": "查看推送轨迹",
"com.alibaba.nacos.component.NewNameSpace.newnamespce": "新建命名空间",
"com.alibaba.nacos.page.pushTrajectory.please_enter_a_query_Ip": "请输入查询IP",
"nacos.page.configurationManagement.export": "导出",
"com.alibaba.nacos.page.newconfig.new_listing_main": "新建配置",
"nacos.component.CloneDialog.select_namespace": "请选择命名空间",
"nacos.page.newconfig.Note_You_are_to_be_a_custom_packet_the_new_configuration,_make_sure_that_t": "注您正在往一个自定义分组新增配置请确保客户端使用的Pandora版本高于3.4.0,否则可能读取不到该配置。",
"com.alibaba.nacos.component.NameSpaceList.Announcement_nodejs_version_is_developed,supports_a_c": "公告Node.js版上线。支持定制消息。",
"com.alibaba.nacos.page.configRollback.rollback_successful": "回滚成功",
"com.alibaba.nacos.page.pushTrajectory.getconifg": "配置推送 or 主动获取",
"com.alibaba.nacos.component.MiddleWareEnv.ungrouped": "未分组",
"nacos.page.configurationManagement.unprocessed_entry": "未处理的条目:",
"nacos.page.configurationManagement.ecs_ram_role": "自动下发 AccessKey 和 SecretKey (生产环境推荐):",
"com.alibaba.nacos.component.DiffEditorDialog.of_the_current_area": "当前值",
"com.alibaba.nacos.component.AddGroup.group_name": "Group名",
"nacos.page.configurationManagement.Important_reminder0": "重要提醒",
"com.alibaba.nacos.page.pushTrajectory.the_query_results:_a_total_query_to": "查询结果:共查询到",
"configRollback": "配置回滚",
"com.alibaba.nacos.page.pushTrajectory.please_input_Group": "请输入Group",
"nacos.component.validateDialog.cancel": "取消",
"nacos.page.namespace.namespace_name": "命名空间名称:",
"com.alibaba.nacos.page.namespace.namespace_names": "命名空间名称",
"nacos.page.newconfig.off1": "关",
"com.alibaba.nacos.page.pushTrajectory.getconfig": "获取配置",
"nacos.page.namespace.SecretKey_recommended3": "SecretKey开发环境推荐:",
"com.alibaba.nacos.page.pushTrajectory.configok": "新配置生效",
"nacos.component.ImportDialog.To_terminate_the_import0": "终止导入",
"nacos.page.configurationManagement.view_details1": "查看详情",
"com.alibaba.nacos.page.historyRollback.article_meet": "条满足要求的配置。",
"nacos.page.newconfig.data_encryption3": "数据加密:",
"com.alibaba.nacos.page.pushTrajectory.user_Ip": "用户IP",
"com.alibaba.nacos.page.pushTrajectory.please_enter_the_dataID": "请输入Data ID",
"nacos.page.namespace.remove_the_namespace": "删除命名空间",
"com.alibaba.nacos.page.configurationManagement.listener_query": "监听查询",
"com.alibaba.nacos.page.consistencyEfficacy.edit": "编辑",
"com.alibaba.nacos.component.EditorNameSpace.load": "命名空间名:",
"com.alibaba.nacos.component.MiddleWareEnv.performance": "性能",
"nacos.page.namespace._Remove_the_namespace_success": "删除命名空间成功",
"nacos.page.configurationManagement.note_ACM_is_dedicated_AK/SK_is_mainly_used_for_some_of_the_compatibility_scenario,_it_is_recommended_to_Unified_the_use_of_Ali_cloud_AK/SK.7": "注ACM 专用AK/SK主要用于一些兼容性场景推荐您统一采用阿里云AK/SK。",
"com.alibaba.nacos.page.historyRollback.to_configure": "历史版本(保留30天)",
"com.alibaba.nacos.page.pushTrajectory.interval": "时间区间:",
"com.alibaba.nacos.page.consistencyEfficacy.details": "详情",
"com.alibaba.nacos.component.EditorNameSpace.edit_namespace": "加载中...",
"com.alibaba.nacos.page.newconfig.do_not_ente": "请勿输入非法字符",
"com.alibaba.nacos.component.MiddleWareEnv.from-test": "自测",
"nacos.page.configurationManagement.Please_enter_application_name1": "请输入应用名",
"nacos.component.ImportDialog.You_can_only_upload._zip_file_format0": "只能上传.zip格式的文件",
"com.alibaba.nacos.page.configeditor.stop_beta": "停止Beta",
"com.alibaba.nacos.component.SuccessDialog.failure": "失败",
"nacos.page.configurationManagement.bulk_delete": "批量删除",
"com.alibaba.nacos.page.historyRollback.details": "详情",
"com.alibaba.nacos.page.configeditor.more_advanced_options": "收起",
"com.alibaba.nacos.page.configdetail.configuration": "配置内容:",
"nacos.component.CloneDialog.configuration_number": "配置数量:",
"com.alibaba.nacos.component.EditorNameSpace.public_space": "确认修改",
"chaxunfanwei": "查询范围",
"com.alibaba.nacos.page.newconfig.full_screen": "按Esc退出全屏",
"com.alibaba.nacos.page.configeditor.the_target_environment:": "归属应用:",
"hour": "小时",
"com.alibaba.nacos.page.namespace.configuration": "配置数",
"nacos.page.configurationManagement.Cloning_check_fails": "克隆检查失败",
"com.alibaba.nacos.component.NewNameSpace.namespacenotnull": "命名空间不能为空",
"com.alibaba.nacos.page.configeditor.beta_release_notes(default_not_checked)": "Beta发布",
"nacos.page.newconfig.to_the_authorization_of2": "去授权 》",
"com.alibaba.nacos.page.configeditor.return": "发布",
"com.alibaba.nacos.page.configurationManagement.more": "更多",
"com.alibaba.nacos.component.EnvConfigTopBar.context_switching": "环境切换",
"com.alibaba.nacos.component.SuccessDialog.Configuration_management": "配置管理",
"nacos.component.ImportDialog.cover2": "覆盖",
"com.alibaba.nacos.page.configurationManagement.last_modified_time": "最后修改时间",
"com.alibaba.nacos.page.newconfig.dataId_is_not_empty": "Data ID 长度不能超过255字符",
"com.alibaba.nacos.page.configeditor.configcontent": "配置内容",
"com.alibaba.nacos.component.NewNameSpace.input": "请勿输入非法字符",
"com.alibaba.nacos.page.configRollback.updated": "更新",
"com.alibaba.nacos.page.pushTrajectory.user_Ip:": "用户IP",
"nacos.component.DeleteDialog.delete_the_configuration_failed": "删除配置失败",
"com.alibaba.nacos.component.SuccessDialog.success": "成功",
"nacos.page.configurationManagement._The_process_is_successful,_delete_the": "处理成功,删除了",
"com.alibaba.nacos.component.NewNameSpace.prompt": "提示",
"com.alibaba.nacos.page.configRollback.please_confirm_rollback": "回滚配置",
"com.alibaba.nacos.page.pushTrajectory.the_query_results": "查询结果:共查询到",
"com.alibaba.nacos.page.historyRollback.group": "请输入Group",
"nacos.component.ExportDialog.export_configuration4": "导出配置(",
"com.alibaba.nacos.page.consistencyEfficacy.configuration_consistency_check": "配置一致性校验",
"com.alibaba.nacos.page.newconfig.stop_beta": "停止Beta发布",
"com.alibaba.nacos.page.historyDetail.home": "归属应用:",
"nacos.component.ExportDialog.export3": "导出",
"com.alibaba.nacos.page.pushTrajectory.cluster_synchronization": "集群间同步通知",
"nacos.page.namespace.ecs_ram_role": "自动下发 AccessKey 和 SecretKey (生产环境推荐):",
"nacos.component.CloneDialog.HOME_Application": "归属应用:",
"nacos.page.namespace.Namespace": "命名空间",
"com.alibaba.nacos.component.EditorNameSpace.please_do": "请勿输入非法字符",
"com.alibaba.nacos.page.listeningToQuery.configuration": "配置",
"com.alibaba.nacos.component.MiddleWareEnv.cloud_unit": "云单元",
"nacos.page.configurationManagement.Clone_failed": "克隆失败",
"nacos.page.newconfig.The_opening_of_the_data_encryption-related_services0": "开通数据加密相关服务",
"com.alibaba.nacos.component.NewDatePicker.recently": "取消",
"com.alibaba.nacos.component.editorNameSpace": "私有空间",
"com.alibaba.nacos.page.configeditor.configuration_format:": "默认不要勾选。点击了解Beta发布详情。",
"pushTrajectory": "推送轨迹",
"com.alibaba.nacos.component.MiddleWareEnv.daily": "日常",
"nacos.component.ExportDialog.HOME_Application1": "归属应用:",
"nacos.page.newconfig._to_go_to_the_opening_of1": "\t 去开通 》",
"com.alibaba.nacos.component.NewDatePicker.determine": "至",
"nacos.page.configurationManagement.advanced_query9": "高级查询",
"nacos.page.configurationManagement.configuration": "项配置",
"nacos.page.configurationManagement.AccessKey_recommended2": "AccessKey推荐:",
"configeditor": "配置编辑",
"com.alibaba.nacos.page.listAllEnvironmental.all_available_environment": "所有可用环境",
"com.alibaba.nacos.page.newconfig.configuration_contentmax": "配置内容最大长度不能超过10240字符",
"com.alibaba.nacos.page.configdetail.error": "错误",
"com.alibaba.nacos.component.NameSpaceList.immediate_use": "立即使用",
"com.alibaba.nacos.page.newconfig.Group_ID_cannot_be_longer": "归属应用:",
"listeningToQuery": "监听查询",
"Configdetail": "配置详情",
"com.alibaba.nacos.page.listAllEnvironmental.environment_marked": "环境标示",
"com.alibaba.nacos.page.configsync.configuration": "配置内容:",
"configdetail": "配置详情",
"com.alibaba.nacos.page.historyDetail.insert": "插入",
"com.alibaba.nacos.page.configdetail.official": "正式",
"nacos.page.configurationManagement.questionnaire2": "问卷调查",
"com.alibaba.nacos.component.AddGroup.prompt": "提示",
"com.alibaba.nacos.layout.noenv.app_configuration_management_acm": "NACOS",
"nacos.page.configurationManagement.process_is_successful,_import_the": "处理成功,导入了",
"nacos.component.DeleteDialog.Configuration_management": "配置管理",
"com.alibaba.nacos.page.consistencyEfficacy.configuration_content_md5": "配置内容MD5",
"com.alibaba.nacos.page.configRollback.return": "返回",
"com.alibaba.nacos.page.configurationManagement.details": "详情",
"nacos.page.namespace.details": "详情",
"com.alibaba.nacos.page.listeningToQuery.query_results:_query": "查询结果:共查询到",
"com.alibaba.nacos.page.configurationManagement.fuzzyg": "模糊查询请输入Group",
"nacos.component.NameSpaceList.Forum": "论坛",
"nacos.component.ShowCodeing.,_new_ConfigChangeListener()_{_public_void_receiveConfigInfo(String": "\", new ConfigChangeListener() {\t\t\t\tpublic void receiveConfigInfo(String configInfo) {\t\t\t\t\t// 当配置更新后,通过该回调函数将最新值吐给用户。\t\t\t\t\t// 注意回调函数中不要做阻塞操作,否则阻塞通知线程。\t\t\t\t\tconfig = configInfo;\t\t\t\t\tSystem.out.println(configInfo);\t\t\t\t}\t\t\t});\t\t\t\t\t\t/**\t\t\t * 如果配置值的內容为properties格式key=value, 可使用下面监听器。以便一个配置管理多个配置项\t\t\t */\t\t\t\t\t\t/**\t\t\tConfigService.addListener(\"",
"com.alibaba.nacos.page.consistencyEfficacy.advanced_query": "高级查询",
"com.alibaba.nacos.page.listeningToQuery.please_enter_the_dataid": "请输入Data ID",
"nacos.component.ShowCodeing.,_6000);_System.out.println(content);_//_初始化的时候给配置添加监听,配置变更会回调通知_ConfigService.addListener(": "\", 6000);\t\t\tSystem.out.println(content);\t\t\t// 初始化的时候,给配置添加监听,配置变更会回调通知\t\t\tConfigService.addListener(\"",
"nacos.component.CloneDialog.|_the_selected_entry": "| 选中的条目",
"nacos.page.newconfig.Data_encryption0": "数据加密",
"com.alibaba.nacos.page.environmentalManagement.environment_marked": "环境标示",
"com.alibaba.nacos.page.listeningToQuery.listener_query": "监听查询",
"nacos.component.ExportDialog.|_The_selected_entry0": "| 选中的条目",
"com.alibaba.nacos.page.consistencyEfficacy.query_results": "查询结果",
"nacos.page.namespace.deleted_successfully": "删除成功",
"nacos.component.CloneDialog.cover": "覆盖",
"com.alibaba.nacos.page.environmentalManagement.Into_the": "进入",
"com.alibaba.nacos.page.configdetail.more_advanced_options": "更多高级选项",
"com.alibaba.nacos.page.listeningToQuery.query_dimension": "查询维度:",
"com.alibaba.nacos.page.configRollback.configuration": "配置内容:",
"com.alibaba.nacos.page.historyDetail.more_advanced_options": "更多高级选项",
"com.alibaba.nacos.page.consistencyEfficacy.query": "查询",
"com.alibaba.nacos.page.listeningToQuery.please_input_ip": "请输入IP",
"com.alibaba.nacos.component.NewDatePicker.end_time_must_be_greater_than_the_start_time_of_the_t": "结束时间必须大于开始时间",
"com.alibaba.nacos.page.listAllEnvironmental.view": "查看",
"nacos.component.ShowCodeing.*///_ConfigService.init();_//_主动获取配置_String_content_=_ConfigService": "*///\t\t\tConfigService.init();\t\t\t\t\t\t// 主动获取配置\t\t\tString content = ConfigService.getConfig(\"",
"com.alibaba.nacos.page.newconfig.configure_contents_of": "按F1显示全屏",
"com.alibaba.nacos.page.listeningToQuery.success": "成功",
"com.alibaba.nacos.component.NewDatePicker.30_minutes": "30分钟",
"com.alibaba.nacos.page.historyDetail.history_details": "历史详情",
"com.alibaba.nacos.page.listeningToQuery.query": "查询",
"com.alibaba.nacos.page.newconfig.the_target_environment": "配置格式:",
"com.alibaba.nacos.layout.noenv.does_not_exist": "您访问的页面不存在",
"nacos.component.ImportDialog.file_upload_directly_after_importing_the_configuration,_please_be_": "文件上传后将直接导入配置,请务必谨慎操作",
"nacos.page.configurationManagement.ACM_dedicated_AccessKey_will_the_waste,_does_not_recommend_the_use_of5": "ACM专用AccessKey即将废弃不建议使用:",
"nacos.page.configurationManagement.import": "导入",
"com.alibaba.nacos.page.configurationManagement.suredelete": "确定要删除以下配置吗?",
"com.alibaba.nacos.page.configeditor.release_beta": "按Esc退出全屏",
"nacos.page.configurationManagement.no_announcement6": "暂无公告",
"com.alibaba.nacos.component.NewDatePicker.query_range:": "自定义",
"com.alibaba.nacos.page.configRollback.belongs_to": "所属地域:",
"com.alibaba.nacos.page.pushTrajectory.query_dimension:": "查询维度:",
"com.alibaba.nacos.component.MiddleWareEnv.payTM_daily": "payTM日常",
"nacos.page.configurationManagement.ACM_special_SecretKey_will_be_abandoned,_not_recommended_for_use6": "ACM专用SecretKey即将废弃不建议使用:",
"com.alibaba.nacos.page.configurationManagement.query": "查询",
"com.alibaba.nacos.component.MiddleWareEnv.offline": "线下",
"com.alibaba.nacos.page.listeningToQuery.article_meet_the_requirements_of_the_configuration.": "条满足要求的配置。",
"com.alibaba.nacos.page.configurationManagement.Remove_configuration": "删除配置",
"recent": "最近",
"com.alibaba.nacos.page.configeditor.F1/fn F1(MAC)full_screen": "配置内容",
"nacos.page.configurationManagement.off_the_Bulletin_Board5": "关闭公告栏",
"com.alibaba.nacos.page.historyDetail.action_type": "操作类型:",
"com.alibaba.nacos.page.listAllEnvironmental.environment_IP": "环境IP",
"nacos.component.CloneDialog.source_space": "源空间:",
"nacos.page.configurationManagement.click_on_the_obtain_of3": "点击获取 》",
"com.alibaba.nacos.page.configurationManagement.article_meet_the_requirements": "条满足要求的配置。",
"com.alibaba.nacos.page.historyRollback.operation": "操作",
"nacos.component.ShowCodeing.);_/**_*_生产环境通过jvm参数传参以便使用多个环境_-Dacm.endpoint=": "\");\t\t\t\t\t\t/**\t\t\t * 生产环境通过JVM参数传参以便使用多个环境 -Dacm.endpoint=",
"com.alibaba.nacos.page.historyDetail.return": "返回",
"nacos.page.configurationManagement.failed_entry": "失败的条目:",
"nacos.component.CloneDialog.start_cloning": "开始克隆",
"com.alibaba.nacos.page.configRollback.the_following_configuration": "以下配置吗?",
"com.alibaba.nacos.page.configurationManagement.query_results": "查询结果:共查询到",
"nacos.page.configurationManagement.a_ACM_front-end_monitoring_questionnaire,_the_time_limit_to_receive_Ali_cloud_voucher_details_shoved_stamp_the3": "答 ACM 前端监控调查问卷,限时领取阿里云代金券\t 详情猛戳:",
"com.alibaba.nacos.component.MiddleWareEnv.online_center": "线上中心",
"com.alibaba.nacos.page.serviceManagement.service_list": "服务列表",
"com.alibaba.nacos.page.serviceManagement.service_name": "服务名称",
"com.alibaba.nacos.page.serviceManagement.please_enter_the_service_name": "请输入服务名称",
"com.alibaba.nacos.page.serviceManagement.query": "查询",
"serviceManagement": "服务列表"
},
"en-us": {
"com.alibaba.nacos.layout.noenv.nacosversion":"1.0",
"nacos.component.CloneDialog.the_same_configuration": "Conflict:",
"to": "to",
"nacos.page.newconfig.data_encryption3": "Data Encryption:",
"nacos.page.configurationManagement.batch_management": "Batch Operation",
"com.alibaba.nacos.page.configsync.return": "Back",
"com.alibaba.nacos.page.pushTrajectory.getconfig": "Get Configuration",
"cancel": "Cancel",
"nacos.component.CloneDialog.Terminate_the_clone0": "Terminate",
"com.alibaba.nacos.component.NewNameSpace.newnamespce": "Create Namespace",
"com.alibaba.nacos.page.pushTrajectory.Data_Id_can_not_be_empty": "Data ID cannot be empty",
"com.alibaba.nacos.component.MiddleWareEnv.maletest": "male. test",
"com.alibaba.nacos.page.configeditor.group_is_not_empty": "Advanced Options",
"com.alibaba.nacos.component.editorNameSpace": "Dedicated Space",
"nacos.component.CloneDialog.target_space": "Target:",
"nacos.page.newconfig.off1": "Off",
"com.alibaba.nacos.component.NameSpaceList.Announcement_nodejs_version_is_developed,supports_a_c": "Announcement: Node.js version now available, supporting customized messages.",
"com.alibaba.nacos.page.pushTrajectory.user_Ip": "User IP:",
"nacos.page.configurationManagement.a_ACM_front-end_monitoring_questionnaire,_the_time_limit_to_": "a ACM front-end monitoring questionnaire, the time limit to receive Ali cloud voucher details shoved stamp: the",
"nacos.page.configurationManagement.Important_reminder0": "Important reminder",
"com.alibaba.nacos.page.pushTrajectory.the_query_results:_a_total_query_to": "Results: Found",
"com.alibaba.nacos.page.configdetail.belongs_to_the_environment": "Region:",
"com.alibaba.nacos.page.configurationManagement.operation": "Actions",
"com.alibaba.nacos.layout.noenv.app_configuration_management_ACM": "NACOS",
"nacos.page.namespace.note_ACM_is_dedicated_AK/SK_is_mainly_used_for_some_of_the_compatibility_scenario,_it_is_recommended_to_Unified_the_use_of_Ali_cloud_AK/SK.5": "Note: ACM's dedicated AK/SK is mainly used for improved compatibilities. We recommend that you always use Alibaba Cloud AK/SK.",
"com.alibaba.nacos.component.ShowCodeing.Sample_code": "Sample Code",
"nacos.page.newconfig.Open0": "Open",
"custom": "Customize",
"com.alibaba.nacos.page.pushTrajectory.Group_Id_cannot_be_empty": "Group name cannot be empty",
"com.alibaba.nacos.page.environmentalManagement.operation": "operation",
"com.alibaba.nacos.page.configRollback.environment": "Region:",
"com.alibaba.nacos.page.pushTrajectory.please_enter_a_query_Ip": "Enter IP",
"confirm": "OK",
"nacos.page.configurationManagement.successful_entry": "Successful Entry:",
"com.alibaba.nacos.page.configurationManagement.configuration_query": "Configuration Search",
"nacos.page.configurationManagement._Details_of8": " Details of",
"com.alibaba.nacos.page.namespace.add": "Create Namespace",
"nacos.component.ImportDialog.the_same_configuration6": "Conflict:",
"com.alibaba.nacos.page.pushTrajectory.Push_the_trajectory": "Push Tracks",
"configsync": "Synchronize Configuration",
"nacos.page.namespace.Namespace_details": "Namespace details",
"dateinfo1": "The end time must be greater than the start time",
"com.alibaba.nacos.page.newconfig.group_is_not_empty": "Group ID cannot exceed 127 characters in length",
"com.alibaba.nacos.page.configurationManagement.click_to_learn_DataId": "Learn more about Data ID",
"com.alibaba.nacos.page.configdetail.configuration_details": "Configuration Details",
"com.alibaba.nacos.page.namespace.edit": "Edit",
"nacos.page.newconfig.Tags": "Tags:",
"nacos.page.configurationManagement.please_choose_the_required_export_configuration_items10": "Please select configuration items to export.",
"nacos.page.namespace.namespace_name": "Name:",
"com.alibaba.nacos.component.MiddleWareEnv.ungrouped": "Ungrouped",
"nacos.component.ImportDialog.target_space5": "Target:",
"com.alibaba.nacos.page.pushTrajectory.configok": "New Configuration Published",
"com.alibaba.nacos.page.newconfig.esc_exit": "Publish",
"nacos.page.namespace.ACM_dedicated_AccessKey_will_the_waste,_does_not_recommend_the_use_of3": "ACM dedicated AccessKey will the waste, does not recommend the use of:",
"nacos.page.configurationManagement.ACM_dedicated_AccessKey_will_the_waste,_does_not_recommend_t": "ACM dedicated AccessKey will the waste, does not recommend the use of:",
"com.alibaba.nacos.page.newconfig.the_more_advanced": "Group cannot be empty",
"nacos.page.configurationManagement.SecretKey_recommended5": "SecretKey (Recommended for development environment):",
"nacos.page.configurationManagement.Configuration_cloning0": "Clone",
"com.alibaba.nacos.page.pushTrajectory.configuration": "Configuration",
"com.alibaba.nacos.page.newconfig.new_listing_main": "Create Configuration",
"nacos.page.configurationManagement.Batch_processing0": "Batch processing",
"com.alibaba.nacos.page.configeditor.look": "View Push Track",
"com.alibaba.nacos.page.configsync.sync_configuration": "Synchronize Configuration Successfully",
"com.alibaba.nacos.page.configeditor.official": "Official",
"nacos.page.configeditor.Data_encryption0": "Data encryption",
"nacos.component.NameSpaceList.Announcement_nodejs_version_is_developed,supports_a_custom_messag": "Announcement: Node.JS version now available, supporting customized messages.",
"com.alibaba.nacos.page.historyDetail.update": "Update",
"com.alibaba.nacos.page.pushTrajectory.user_IP": "IP",
"nacos.component.ImportDialog.Upload_File3": "Upload File",
"com.alibaba.nacos.component.NewDatePicker.60_-_": "60 minutes",
"nacos.page.configurationManagement.note_ACM_is_dedicated_AK/SK_is_mainly_used_for_some_of_the_c": "note: ACM is dedicated AK/SK is mainly used for some of the compatibility scenario, it is recommended to Unified the use of Ali cloud AK/SK.",
"com.alibaba.nacos.page.newconfig.Data_ID_length": "Collapse",
"nacos.page.configurationManagement.Please_enter_the_name_of_the_app1": "Enter App Name\n",
"com.alibaba.nacos.page.configeditor.toedittitle": "Edit Configuration",
"nacos.component.CloneDialog.configuration_number": "Items:",
"chaxunfanwei": "Query Range",
"com.alibaba.nacos.page.configeditor.beta_release_notes(default_not_checked)": "Beta Publish:",
"nacos.page.configurationManagement.open_Bulletin_Board7": "open Bulletin Board",
"com.alibaba.nacos.component.SuccessDialog.failure": "Failed",
"com.alibaba.nacos.component.ShowCodeing.loading": "Loading...",
"com.alibaba.nacos.page.configsync.home": "Application",
"minute": " minutes",
"cspupcloud.page.historyRollback.Retained_for_30_days": "Retained for 30 days",
"com.alibaba.nacos.page.configRollback.delete": "Delete",
"com.alibaba.nacos.page.configeditor.beta_release:": "Target Region:",
"com.alibaba.nacos.page.consistencyEfficacy.environment_name": "environment name",
"com.alibaba.nacos.component.SuccessDialog.success": "Successful",
"com.alibaba.nacos.page.namespace.configuration": "Number of Configurations",
"hour": " hours",
"com.alibaba.nacos.page.configRollback.please_confirm_rollback": "Roll Back",
"nacos.page.configurationManagement.ACM_special_SecretKey_will_be_abandoned,_not_recommended_for_use6": "ACM's dedicated SecretKey (To be deprecated soon and not recommended):",
"nacos.component.ExportDialog.source_space5": "Source:",
"com.alibaba.nacos.component.SuccessDialog.determine": "OK",
"com.alibaba.nacos.component.EnvConfigTopBar.context_switching": "Switch Region",
"nacos.component.DeleteDialog.delete_the_configuration_failed": "Deleting configuration failed",
"com.alibaba.nacos.page.configurationManagement.more": "More",
"com.alibaba.nacos.page.pushTrajectory.please_enter_the_dataID": "Enter Data ID",
"com.alibaba.nacos.page.configRollback.inserted": "Insert",
"com.alibaba.nacos.page.configeditor.Home_application:": "Group name cannot be empty",
"com.alibaba.nacos.page.configurationManagement.environment": "Region:",
"com.alibaba.nacos.component.NewNameSpace.prompt": "Notice",
"com.alibaba.nacos.page.configurationManagement.push_track": "Push Track",
"hanxie.show": "test",
"com.alibaba.nacos.page.configdetail.configuration": "Configuration Content:",
"com.alibaba.nacos.pubshow": "The sub-account is not anthorized. Contact the owner of the primary account to grant permission first.",
"com.alibaba.nacos.page.newconfig.stop_fails": "Failed to stop beta publishing.",
"com.alibaba.nacos.page.newconfig.group_placeholder": "Enter your group name",
"nacos.page.namespace._Remove_the_namespace_success": " Remove the namespace success",
"com.alibaba.nacos.component.MiddleWareEnv.from-test": "Self-Test",
"com.alibaba.nacos.component.EditorNameSpace.public_space": "OK",
"com.alibaba.nacos.page.consistencyEfficacy.details": "Details",
"com.alibaba.nacos.page.configeditor.vdchart": "Illegal characters not allowed",
"nacos.page.configurationManagement.Please_enter_application_name1": "Enter App Name",
"com.alibaba.nacos.page.pushTrajectory.query_dimension:": "Dimension:",
"nacos.page.namespace.sure_you_want_to_delete_the_following_namespaces?": "Sure you want to delete the following namespaces?",
"nacos.component.ImportDialog.cover2": "Overwrite",
"com.alibaba.nacos.component.MiddleWareEnv.daily_stable": "Daily Stable",
"com.alibaba.nacos.component.EditorNameSpace.edit_namespace": "Loading...",
"com.alibaba.nacos.page.newconfig.dataId_is_not_empty": "Data ID cannot exceed 255 characters in length",
"com.alibaba.nacos.page.configurationManagement.article_meet_the_requirements": "configuration items",
"com.alibaba.nacos.component.NewNameSpace.name": "Namespace:",
"com.alibaba.nacos.page.configeditor.more_advanced_options": "Collapse",
"com.alibaba.nacos.page.historyRollback.details": "Details",
"nacos.page.newconfig._to_go_to_the_opening_of1": " to go to the opening of",
"nacos.page.configurationManagement.please_select_the_required_delete_the_configuration_item": "Select configuration items to delete",
"nacos.component.DeleteDialog.deletetitle": "Delete Configuration",
"com.alibaba.nacos.page.configeditor.recipient_from": "Data ID cannot be empty",
"nacos.page.namespace.namespace_ID": "ID:",
"com.alibaba.nacos.component.MiddleWareEnv.Spas_dedicated": "Spas Dedicated",
"historyRollback": "Historical Versions",
"com.alibaba.nacos.page.newconfig.full_screen": "Press Esc to exit",
"com.alibaba.nacos.page.listAllEnvironmental.environment_marked": "environment marked",
"nacos.page.namespace.delete_failed": "Failed to Delete",
"com.alibaba.nacos.page.configsync.configuration": "Configuration Content",
"configeditor": "Edit Configuration",
"com.alibaba.nacos.component.NameSpaceList.immediate_use": "Try Now",
"com.alibaba.nacos.page.configRollback.rollback": "Roll Back",
"com.alibaba.nacos.page.configeditor.configuration_format:": "Deselected by default. Learn more about beta publishing.\n",
"com.alibaba.nacos.page.listAllEnvironmental.environment_name": "environment name,",
"com.alibaba.nacos.page.configeditor.": "Back",
"nacos.component.validateDialog.Click_to_get_verification_code": "Click to Get Verification Code",
"configRollback": "Configuration Rollback",
"com.alibaba.nacos.component.NameSpaceList.Announcement_nodejs_version_is_developed,supports_a_custom_message": "Announcement: Node.js version now available, supporting customized messages.",
"nacos.page.configurationManagement.advanced_query9": "Advanced Query",
"com.alibaba.nacos.page.configdetail.official": "Official",
"nacos.page.configurationManagement.process_is_successful,_the_cloned": "Process successfully, cloned ",
"nacos.component.ShowCodeing.,_new_PropertiesListener()_{_@Override_public_void_innerReceive(Pro": "\", new PropertiesListener() {\t\t\t\t\t\t\t\t@Override\t\t\t\tpublic void innerReceive(Properties properties) {\t\t\t\t\t// TODO Auto-generated method stub\t\t\t\t\tacmProperties = properties;\t\t\t\t\tSystem.out.println(properties);\t\t\t\t}\t\t\t});\t\t\t\t\t\t**/\t\t\t\t\t} catch (ConfigException e) {\t\t\te.printStackTrace();\t\t}\t\t// 测试让主线程不退出,因为订阅配置是守护线程,主线程退出守护线程就会退出。 正式代码中无需下面代码\t\twhile (true) {\t\t\ttry {\t\t\t\tThread.sleep(1000);\t\t\t} catch (InterruptedException e) {\t\t\t\te.printStackTrace();\t\t\t}\t\t}\t}\t // 通过get接口把配置值暴露出去使用 public static String getConfig() { return config; } \t// 通过get接口把配置值暴露出去使用\tpublic static Object getPorpertiesValue(String key) {\t\tif (acmProperties != null) {\t\t\treturn acmProperties.get(key);\t\t}\t\treturn null;\t}}",
"com.alibaba.nacos.page.listeningToQuery.query_dimension": "Dimension:",
"nacos.component.DeleteDialog.determine": "OK",
"com.alibaba.nacos.page.configurationManagement.details": "Details",
"pubnodata": "No results found.",
"configdetail": "Configuration Details",
"com.alibaba.nacos.page.configurationManagement.edit": "Edit",
"com.alibaba.nacos.page.listAllEnvironmental.view_environment_IP": "View environment IP",
"com.alibaba.nacos.page.historyDetail.home": "Application:",
"com.alibaba.nacos.page.configeditor.configuration_formatpre": "Deselected by default. ",
"com.alibaba.nacos.component.AddGroup.prompt": "Notice",
"com.alibaba.nacos.page.consistencyEfficacy.configuration_content_md5": "Configuration Content MD5",
"com.alibaba.nacos.component.NameSpaceList.online_customer_support": "Online Customer Support:",
"nacos.page.configurationManagement.Delete_failed": "Delete failed",
"com.alibaba.nacos.page.consistencyEfficacy.edit": "Edit",
"nacos.component.ExportDialog.HOME_Application1": "Application:",
"com.alibaba.nacos.page.configurationManagement.fuzzyd": "Enter Data ID",
"com.alibaba.nacos.page.listeningToQuery.query": "Search",
"com.alibaba.nacos.component.MiddleWareEnv.daily_environment_packet": "Daily Environment Group",
"com.alibaba.nacos.component.NewDatePicker.to": "Search Range:",
"nacos.component.ExportDialog.export3": "Export",
"com.alibaba.nacos.layout.noenv.Click_to_learn_the_namespace": "Learn more about namespace",
"com.alibaba.nacos.page.pushTrajectory.determine": "Search",
"com.alibaba.nacos.page.historyRollback.dataid": "Enter Data ID",
"nacos.page.namespace.SecretKey_recommended3": "SecretKey (Recommended for development environment):",
"com.alibaba.nacos.page.historyDetail.insert": "Insert",
"com.alibaba.nacos.component.MiddleWareEnv.daily_units": "Daily Units",
"nacos.component.validateDialog.confirm": "confirm",
"com.alibaba.nacos.component.EditorNameSpace.please_do": "Illegal characters not allowed",
"nacos.page.configurationManagement.view_details1": "view details",
"com.alibaba.nacos.component.NewDatePicker.to_cancel_the": "OK",
"nacos.component.validateDialog.phoneNumber": "Mobile phone number:",
"com.alibaba.nacos.page.newconfig.Group_ID_cannot_be_longer": "Application:",
"nacos.page.newconfig.The_opening_of_the_data_encryption-related_services0": "The Opening of the Data Encryption-Related Services",
"com.alibaba.nacos.component.MiddleWareEnv.cloud_unit": "Cloud Unit",
"com.alibaba.nacos.component.NewDatePicker.recently": "Cancel",
"nacos.page.namespace.Namespace": "Namespaces",
"com.alibaba.nacos.page.listAllEnvironmental.operation": "operation",
"nacos.page.configurationManagement.select_need_to_clone_the_configuration_items1": "Please select configuration items to clone.",
"nacos.page.configurationManagement.ACM_dedicated_AccessKey_will_the_waste,_does_not_recommend_the_use_of5": "ACM's dedicated AccessKey (To be deprecated soon and not recommended):",
"nacos.component.CloneDialog.tags": "tags:",
"com.alibaba.nacos.component.NewNameSpace.confirm": "OK",
"com.alibaba.nacos.page.configRollback.home": "Application:",
"nacos.page.configurationManagement.a_ACM_front-end_monitoring_questionnaire,_the_time_limit_to_receive_Ali_cloud_voucher_details_shoved_stamp_the3": "a ACM front-end monitoring questionnaire, the time limit to receive Ali cloud voucher details shoved stamp: the",
"com.alibaba.nacos.page.configeditor.Esc_exit": "Press F1 to view in full screen",
"nacos.page.configurationManagement.click_on_the_obtain_of3": "Click on the obtain of",
"com.alibaba.nacos.page.listAllEnvironmental.view": "View",
"nacos.page.configeditor.Description": "Description:",
"com.alibaba.nacos.page.historyDetail.belongs_to_the_environment": "Region:",
"nacos.page.configurationManagement.off_the_Bulletin_Board5": "off the Bulletin Board",
"com.alibaba.nacos.page.configeditor.release_beta": "Press Esc to exit ",
"com.alibaba.nacos.page.configurationManagement.Remove_configuration": "Delete Configuration",
"nacos.page.namespace.deleted_successfully": "Deleted successfully",
"nacos.component.CloneDialog.configuration_cloning": "Clone",
"com.alibaba.nacos.page.configRollback.configuration": "Configuration Content:",
"com.alibaba.nacos.component.DiffEditorDialog.original_value": "Original Value",
"com.alibaba.nacos.page.historyDetail.return": "Back",
"com.alibaba.nacos.page.configeditor.configure_contents_of": "Format:",
"com.alibaba.nacos.page.listeningToQuery.article_meet_the_requirements_of_the_configuration.": "configuration items.",
"com.alibaba.nacos.page.configurationManagement.query": "Search",
"com.alibaba.nacos.page.historyRollback.last_update_time": "Last Modified At",
"nacos.component.CloneDialog.source_space": "Source :",
"nacos.component.ShowCodeing.);_/**_*_生产环境通过jvm参数传参以便使用多个环境_-Dacm.endpoint=": "\");\t\t\t\t\t\t/**\t\t\t * 生产环境通过JVM参数传参以便使用多个环境 -Dacm.endpoint=",
"com.alibaba.nacos.layout.noenv.does_not_exist": "The page you visit does not exist",
"com.alibaba.nacos.page.historyDetail.configure_content": "Configuration Content:",
"nacos.component.ShowCodeing.*///_ConfigService.init();_//_主动获取配置_String_content_=_ConfigService.getConfig(": "*///\t\t\tConfigService.init();\t\t\t\t\t\t// 主动获取配置\t\t\tString content = ConfigService.getConfig(\"",
"com.alibaba.nacos.page.configurationManagement.query_results": "Search Results: Found",
"nacos.component.ShowCodeing.,_new_ConfigChangeListener()_{_public_void_receiveConfigInfo(String": "\", new ConfigChangeListener() {\t\t\t\tpublic void receiveConfigInfo(String configInfo) {\t\t\t\t\t// 当配置更新后,通过该回调函数将最新值吐给用户。\t\t\t\t\t// 注意回调函数中不要做阻塞操作,否则阻塞通知线程。\t\t\t\t\tconfig = configInfo;\t\t\t\t\tSystem.out.println(configInfo);\t\t\t\t}\t\t\t});\t\t\t\t\t\t/**\t\t\t * 如果配置值的內容为properties格式key=value, 可使用下面监听器。以便一个配置管理多个配置项\t\t\t */\t\t\t\t\t\t/**\t\t\tConfigService.addListener(\"",
"com.alibaba.nacos.page.consistencyEfficacy.advanced_query": "Advanced Query",
"com.alibaba.nacos.page.historyDetail.delete": "Delete",
"nacos.component.NameSpaceList.Forum": "Forum",
"com.alibaba.nacos.page.namespace.prompt": "Notice",
"com.alibaba.nacos.page.configdetail.more_advanced_options": "Advanced Options",
"com.alibaba.nacos.page.listeningToQuery.listener_query": "Listening Query",
"com.alibaba.nacos.page.newconfig.the_home_application": "Target Region:",
"nacos.page.namespace.click_on_the_obtain_of1": "Click on the obtain of",
"nacos.component.NameSpaceList.Quick_to_learn0": "Learning Path",
"nacos.component.CloneDialog.get_the_namespace_failed": "get the namespace failed",
"com.alibaba.nacos.component.EditorNameSpace.namespace": "Namespace cannot be empty",
"nacos.component.validateDialog.remark": "Tip: The verification code will be sent through SMS to your bound phone number.",
"com.alibaba.nacos.page.consistencyEfficacy.query": "Query",
"com.alibaba.nacos.page.environmentalManagement.environment_name": "environment name,",
"com.alibaba.nacos.page.listAllEnvironmental.environment_IP": "environment IP",
"com.alibaba.nacos.page.listeningToQuery.success": "Success",
"nacos.component.CloneDialog.|_the_selected_entry": "| Selected entry",
"com.alibaba.nacos.component.MiddleWareEnv.offline": "Offline",
"com.alibaba.nacos.page.listeningToQuery.please_input_ip": "Enter IP",
"com.alibaba.nacos.page.historyDetail.recipient_from": "Collapse",
"com.alibaba.nacos.page.newconfig.configuration_format": "Configuration Content",
"com.alibaba.nacos.component.NewDatePicker.query_range:": "Customize",
"nacos.component.CloneDialog.skip": "Skip",
"com.alibaba.nacos.page.listeningToQuery.please_enter_the_dataid": "Enter Data ID",
"com.alibaba.nacos.component.NewDatePicker.7_day": "7 days",
"nacos.component.ShowCodeing.-Dproject.name=acmtest_-Dspas.identity=CUserswater.lyl.spas_keyacmt": "-Dproject.name=acmtest -Dspas.identity=C:Userswater.lyl.spas_keyacmtest\t\t\t * 在本地的acmtest文件中填写accessKey/secretKey,格式如下\t\t\t * accessKey=",
"com.alibaba.nacos.service.fill_the_code": "Please fill out the verification code",
"com.alibaba.nacos.page.historyDetail.more_advanced_options": "Advanced Options",
"com.alibaba.nacos.page.newconfig.configure_contents_of": "Press F1 to view in full screen",
"nacos.component.ImportDialog.file_upload_directly_after_importing_the_configuration,_please_be_": "Caution: Data will be imported directly after uploading.",
"com.alibaba.nacos.page.newconfig.configuration_contentmax": "Configuration content cannot exceed 10240 characters in length",
"com.alibaba.nacos.page.listAllEnvironmental.all_available_environment": "all available environment",
"nacos.page.configurationManagement.configuration_management8": "configuration management",
"com.alibaba.nacos.component.NewDatePicker.": "Last",
"nacos.page.configurationManagement.configuration": " configuration",
"nacos.page.configurationManagement._The_process_is_successful,_delete_the": "Process successfully, delete ",
"com.alibaba.nacos.page.configsync.target": "Target Region",
"com.alibaba.nacos.page.newconfig.new_listing": "Create Configuration",
"Configdetail": "Configuration Details",
"nacos.page.configdetail.Tags": "Tags:",
"listeningToQuery": "Listening Query",
"nacos.page.configurationManagement.,_wherein": ", wherein ",
"com.alibaba.nacos.page.configRollback.retracted": "Collapse",
"nacos.component.validateDialog.title": "Account Security Verification",
"com.alibaba.nacos.page.configsync.belongs_to_the_environment": "Region",
"com.alibaba.nacos.page.configeditor.return": "Publish",
"com.alibaba.nacos.page.historyRollback.queryresult": "Search Results: Found",
"com.alibaba.nacos.page.configurationManagement.the_sample_code": "Code Example",
"nacos.page.configurationManagement.Cloning_check_fails": "Cloning check fails",
"nacos.page.configurationManagement.process_is_successful,_import_the": "Process successfully, import ",
"com.alibaba.nacos.page.consistencyEfficacy.environment_marked": "environment marked",
"com.alibaba.nacos.page.namespace.namespace_names": "Namespaces ",
"nacos.page.namespace.details": "Details",
"com.alibaba.nacos.page.configdetail.error": "Error",
"com.alibaba.nacos.component.AddGroup.a_new_group": "Create Group",
"com.alibaba.nacos.component.DiffEditorDialog.contents": "Content Comparison",
"com.alibaba.nacos.page.configRollback.return": "Back",
"com.alibaba.nacos.page.configurationManagement.configuration_management": "Configurations",
"nacos.page.configurationManagement.import_failed": "Import Failed",
"com.alibaba.nacos.page.consistencyEfficacy.operation": "Actions",
"nacos.component.ExportDialog.configuration_number6": "Items:",
"com.alibaba.nacos.page.pushTrajectory.getconifg": "Configuration Push or Get Configuration",
"com.alibaba.nacos.page.environmentalManagement.view_environment_IP": "View environment IP",
"historyDetail": "History Details",
"com.alibaba.nacos.component.EditorNameSpace.private": "Public Space",
"com.alibaba.nacos.page.configdetail.beta_release": "Beta Publish:",
"com.alibaba.nacos.page.historyRollback.group": "Enter Group",
"com.alibaba.nacos.component.NameSpaceList.Prompt": "Notice",
"com.alibaba.nacos.page.pushTrajectory.the_query_results": "Search Results: Found",
"com.alibaba.nacos.page.pushTrajectory.used": "New Configuration Published",
"nacos.page.namespace._Details_of6": " Details of",
"nacos.page.namespace.namespace_number": "Namespace ID",
"com.alibaba.nacos.page.historyrollback.query": "Search",
"nacos.component.ExportDialog.tags2": "Tags:",
"nacos.page.configurationManagement.Please_enter_tag": "Enter Tag",
"nacos.component.ImportDialog.You_can_only_upload._zip_file_format0": "Only upload. zip file format",
"nacos.component.CloneDialog.|_the_selected_entry4": "| Selected Entry",
"com.alibaba.nacos.page.pushTrajectory.track": "push tracks.",
"nacos.page.configurationManagement.HOME_Application0": "Application:",
"com.alibaba.nacos.component.NewDatePicker.24_hours": "24 hours",
"com.alibaba.nacos.component.DiffEditorDialog.confirm_that_the": "Publish",
"nacos.component.ShowCodeing.package_com.alibaba.cloud.acm.sample;import_org.springframework.bea": "package com.alibaba.cloud.acm.sample;import org.springframework.beans.factory.annotation.Value;import org.springframework.boot.ApplicationArguments;import org.springframework.boot.ApplicationRunner;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;import org.springframework.cloud.context.config.annotation.RefreshScope;import org.springframework.stereotype.Component;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RestController;/** * Created on 01/10/2017. * 假设用户配置内容为 * user.id = 0 * user.name = juven.xxxb * user.age = 18 * @author juven.xuxb */@SpringBootApplicationpublic class SampleApplication { public static void main(String[] args) { SpringApplication.run(SampleApplication.class, args); }}@Componentclass SampleRunner implements ApplicationRunner { @Value(\"${user.id}\") String userId; @Value(\"${user.name}\") String userName; @Value(\"${user.age}\") int userAge; public void run(ApplicationArguments args) throws Exception { System.out.println(userId); System.out.println(userName); System.out.println(userAge); }}@RestController@RequestMapping(\"/sample\")@RefreshScopeclass SampleController { @Value(\"${user.name}\") String userName; @RequestMapping(\"/acm\") public String simple() { return \"Hello Spring Cloud ACM!\" \"Hello \" userName \"!\"; }}",
"com.alibaba.nacos.component.EditorNameSpace.prompt": "Notice",
"nacos.page.namespace.AccessKey_recommended1": "AccessKey (Recommended for development environment):",
"com.alibaba.nacos.page.configsync.sync": "Synchronize",
"com.alibaba.nacos.page.historyRollback.to_configure": "Historical Versions (Configuration record is retained for 30 days.)",
"com.alibaba.nacos.page.pushTrajectory.interval": "Time Range:",
"com.alibaba.nacos.component.MiddleWareEnv.daily": "Daily",
"pushTrajectory": "Push Tracks",
"com.alibaba.nacos.component.MiddleWareEnv.switch_environment": "Switch Environment",
"com.alibaba.nacos.component.NewDatePicker.determine": "to",
"nacos.page.configdetail.Open0": "Open",
"com.alibaba.nacos.page.historyRollback.article_meet": "configuration items.",
"com.alibaba.nacos.page.configeditor.release": "Beta Publish",
"nacos.page.newconfig.to_the_authorization_of2": "to the authorization of",
"com.alibaba.nacos.component.NewNameSpace.namespacenotnull": "Namespace cannot be empty",
"nacos.page.newconfig.Note_You_are_to_be_a_custom_packet_the_new_configuration,_make_sure_that_the_client_use_the_Pandora_version_higher_than_3._4._0,_otherwise_it_may_read_less_than_the_configuration.0": "Notice: You are going to add configuration to a new group, please make sure that the version of Pandora which clients are using is higher than 3.4.0, otherwise this configuration may be unreadable to clients.",
"com.alibaba.nacos.page.configRollback.action_type": "Action Type:",
"nacos.page.configurationManagement.SecretKey_recommended4": "SecretKey recommended:",
"nacos.component.validateDialog.cancel": "cancel",
"com.alibaba.nacos.component.AddGroup.group_name": "Group name:",
"nacos.page.configurationManagement.no_longer_display4": "no longer display:",
"com.alibaba.nacos.component.DiffEditorDialog.of_the_current_area": "Current Value",
"com.alibaba.nacos.page.configRollback.belongs_to": "Region:",
"com.alibaba.nacos.page.configeditor.F1/fn F1(MAC)full_screen": "Configuration Content",
"recent": "Last ",
"configurationManagement": "Configurations",
"com.alibaba.nacos.page.historyRollback.operation": "Actions",
"com.alibaba.nacos.page.historyDetail.action_type": "Action Type:",
"com.alibaba.nacos.component.MiddleWareEnv.online": "Online",
"nacos.page.configurationManagement.configuration_item?": "configuration items?",
"com.alibaba.nacos.page.pushTrajectory.configget": "Get Configuration",
"com.alibaba.nacos.page.listeningToQuery._Push_state": "Push Status",
"com.alibaba.nacos.page.listAllEnvironmental.Into_the": "Into the",
"com.alibaba.nacos.page.pushTrajectory.user_Ip:": "User IP:",
"nacos.component.CloneDialog.start_cloning": "Start Clone",
"com.alibaba.nacos.page.configurationManagement.new_listing": "Create Configuration",
"com.alibaba.nacos.component.MiddleWareEnv.online_center": "Online Center",
"nacos.component.ShowCodeing.-Dproject.name=acmtest_-Dspas.identity=CUserswater.lyl.spas_keyacmtest_*_在本地的acmtest文件中填写accessKey/secretKey,格式如下_*_accessKey=": "-Dproject.name=acmtest -Dspas.identity=C:Userswater.lyl.spas_keyacmtest\t\t\t * 在本地的acmtest文件中填写accessKey/secretKey,格式如下\t\t\t * accessKey=",
"com.alibaba.nacos.page.configRollback.for_more_advanced": "Advanced Options",
"com.alibaba.nacos.page.configurationManagement.last_modified_time": "Last Modified At",
"namespace": "Namespaces",
"nacos.page.configdetail.Data_encryption0": "Data encryption",
"com.alibaba.nacos.component.NewDatePicker.3_day": "3 days",
"nacos.component.ShowCodeing.package_com.alibaba.middleware.acm;import_java.util.Properties;impo": "package com.alibaba.middleware.acm;import java.util.Properties;import com.alibaba.edas.acm.ConfigService;import com.alibaba.edas.acm.exception.ConfigException;import com.alibaba.edas.acm.listener.ConfigChangeListener;import com.alibaba.edas.acm.listener.PropertiesListener;// 示例代码仅用于示例测试public class ACMTest { // 属性/开关 private static String config = \"DefaultValue\";\t private static Properties acmProperties = new Properties(); \tpublic static void main(String[] args) {\t\ttry {\t\t\t\t\t\t// 本地调试模式。本机测试无法连接ACM服务集群因此设置debug模式该模式下获取值为null不会进入回调函数。\t\t\t// ConfigService.setDebug(true);\t\t\t\t\t\t// 初始化配置服务,控制台通过示例代码自动获取下面参数\t\t\tConfigService.init(\"",
"com.alibaba.nacos.page.consistencyEfficacy.query_results": "Search Results",
"com.alibaba.nacos.page.environmentalManagement.environment_marked": "environment marked",
"com.alibaba.nacos.page.listeningToQuery.failure": "Failure",
"com.alibaba.nacos.page.environmentalManagement.view": "View",
"com.alibaba.nacos.page.configdetail.home": "Application:",
"com.alibaba.nacos.page.pushTrajectory.please_enter": "Enter IP",
"com.alibaba.nacos.page.historyRollback.rollback": "Roll Back",
"nacos.page.configurationManagement.note_ACM_is_dedicated_AK/SK_is_mainly_used_for_some_of_the_compatibility_scenario,_it_is_recommended_to_Unified_the_use_of_Ali_cloud_AK/SK.7": "Note: ACM's dedicated AK/SK is mainly used for improved compatibilities. We recommend that you always use Alibaba Cloud AK/SK.",
"com.alibaba.nacos.page.consistencyEfficacy.reset": "Reset",
"nacos.component.ExportDialog.export_configuration4": "Export ( ",
"com.alibaba.nacos.page.environmentalManagement.environment_ip": "environment IP",
"com.alibaba.nacos.component.MiddleWareEnv.new_diamond": "Diamond(New Version)",
"com.alibaba.nacos.page.environmentalManagement.Into_the": "Into the",
"com.alibaba.nacos.page.configdetail.recipient_from": "Collapse",
"com.alibaba.nacos.page.configurationManagement.listener_query": "Configuration Listening Query",
"com.alibaba.nacos.page.configurationManagement.suredelete": "Are you sure you want to delete the following configuration?",
"nacos.component.CloneDialog.cover": "Cover",
"nacos.page.configdetail.Description": "Description:",
"com.alibaba.nacos.component.NewDatePicker.end_time_must_be_greater_than_the_start_time_of_the_t": "The end time must be after the starttime",
"nacos.component.ShowCodeing.*///_ConfigService.init();_//_主动获取配置_String_content_=_ConfigService": "*///\t\t\tConfigService.init();\t\t\t\t\t\t// 主动获取配置\t\t\tString content = ConfigService.getConfig(\"",
"com.alibaba.nacos.page.environmentalManagement.all_available_environment": "all available environment",
"nacos.page.configurationManagement.no_announcement6": "no announcement",
"com.alibaba.nacos.page.listeningToQuery.please_input_group": "Enter Group",
"com.alibaba.nacos.page.configsync.for_more_advanced_options": "Advanced Options",
"com.alibaba.nacos.page.historyDetail.history_details": "History Details",
"com.alibaba.nacos.component.NewDatePicker.custom": "The time range cannot exceed 45 days",
"nacos.component.ShowCodeing.,_6000);_System.out.println(content);_//_初始化的时候给配置添加监听,配置变更会回调通知_C": "\", 6000);\t\t\tSystem.out.println(content);\t\t\t// 初始化的时候,给配置添加监听,配置变更会回调通知\t\t\tConfigService.addListener(\"",
"nacos.component.validateDialog.Please_fill_out_the_verification_code": "Enter the verification code:",
"com.alibaba.nacos.page.newconfig.the_target_environment": "Format:",
"nacos.page.configurationManagement.questionnaire2": "questionnaire",
"nacos.page.configdetail.off1": "off",
"nacos.page.configurationManagement.clone": "Clone",
"com.alibaba.nacos.component.MiddleWareEnv.daily_test_center": "Daily Test Center",
"com.alibaba.nacos.page.configRollback.the_following_configuration": "the following configuration?",
"nacos.page.configurationManagement.failed_entry": "Failed Entry:",
"com.alibaba.nacos.component.NewNameSpace.cancel": "Cancel",
"nacos.component.CloneDialog.select_namespace": "Select Namespace",
"nacos.page.configurationManagement.export": "Export",
"nacos.page.configurationManagement.AccessKey_recommended2": "AccessKey recommended:",
"com.alibaba.nacos.component.MiddleWareEnv.line": "Online/",
"com.alibaba.nacos.component.NewNameSpace.loading": "Loading...",
"nacos.page.newconfig.Note_You_are_to_be_a_custom_packet_the_new_configuration,_make_sure_that_t": "Note: You are to be a custom packet the new configuration, make sure that the client use the Pandora version higher than 3. 4. 0, otherwise it may read less than the configuration.",
"com.alibaba.nacos.page.configurationManagement.fuzzyg": "Enter Group",
"com.alibaba.nacos.page.pushTrajectory.interval:": "Time Range:",
"nacos.component.ImportDialog.skip1": "Skip",
"com.alibaba.nacos.page.listeningToQuery.query_results:_query": "Search Results: Found",
"com.alibaba.nacos.page.pushTrajectory.please_input_Group": "Enter Group",
"com.alibaba.nacos.page.configRollback.rollback_successful": "Rollback Successful",
"com.alibaba.nacos.component.MiddleWareEnv.payTM_daily": "payTM Daily",
"nacos.page.configurationManagement.unprocessed_entry": "Unprocessed Entry:",
"nacos.component.ImportDialog.To_terminate_the_import0": "Terminate",
"nacos.page.configurationManagement.import": "Import",
"com.alibaba.nacos.page.configRollback.configuration_rollback": "Configuration Rollback",
"nacos.page.configurationManagement.HOME_Application": "Application",
"com.alibaba.nacos.layout.noenv.app_configuration_management_acm": "NACOS",
"nacos.page.namespace.SecretKey_recommended2": "SecretKey recommended:",
"newconfig": "Create Configuration",
"nacos.component.validateDialog.fill_the_code": "Please fill out the verification code",
"nacos.page.configurationManagement.ecs_ram_role": "Automatically issued the AccessKey and SecretKey (Recommended for production environment):",
"nacos.component.DeleteDialog.Configuration_management": "Configuration Management",
"com.alibaba.nacos.page.pushTrajectory.The_new_configuration_value_persistent": "Configuration Published",
"nacos.page.newconfig.Description": "Description:",
"nacos.component.ImportDialog.Import_configuration4": "Import ( ",
"com.alibaba.nacos.page.configurationManagement.clickfordetail": "Learn more about ACM SDKs",
"com.alibaba.nacos.page.newconfig.collapse": "Advanced Options",
"com.alibaba.nacos.page.configurationManagement.click_to_learn_Group": "Learn more about Group",
"com.alibaba.nacos.component.NewDatePicker.30_minutes": "30 minutes",
"com.alibaba.nacos.page.namespace.delete": "Delete",
"nacos.page.namespace.ACM_special_SecretKey_will_be_abandoned,_not_recommended_for_use4": "ACM special SecretKey will be abandoned, not recommended for use:",
"dateinfo2": "The time range cannot exceed 45 days",
"com.alibaba.nacos.page.newconfig.publish_failed": "Publish failed. Make sure parameters are entered correctly.",
"com.alibaba.nacos.page.consistencyEfficacy.configuration_consistency_check": "Configuration Consistency Check",
"nacos.page.configurationManagement.configuration_export9": "Export",
"com.alibaba.nacos.page.configsync.sync_configuration_main": "Synchronize Configuration",
"com.alibaba.nacos.page.namespace.public": "public(to retain control)",
"com.alibaba.nacos.page.configeditor.wrong": "Error",
"com.alibaba.nacos.page.configsync.error": "Error",
"nacos.page.configurationManagement.ACM_special_SecretKey_will_be_abandoned,_not_recommended_for": "ACM special SecretKey will be abandoned, not recommended for use:",
"com.alibaba.nacos.page.newconfig.release": "Back",
"com.alibaba.nacos.component.NewDatePicker.4_hours": "4 hours",
"com.alibaba.nacos.page.configeditor.toedit": "Edit Configuration",
"nacos.page.configurationManagement.AccessKey_recommended3": "AccessKey (Recommended for development environment):",
"nacos.page.configurationManagement.items_for": " items are ",
"com.alibaba.nacos.page.pushTrajectory.query_dimension": "Query Dimension:",
"com.alibaba.nacos.page.listeningToQuery.configuration": "Configuration",
"com.alibaba.nacos.page.configsync.retracted": "Collapse",
"com.alibaba.nacos.component.NewDatePicker.12_hours": "12 hours",
"nacos.page.pushTrajectory.Please_enter_the_user_IP0": "Enter IP",
"com.alibaba.nacos.component.MiddleWareEnv.international": "Internationalization",
"com.alibaba.nacos.page.configeditor.the_target_environment:": "Application:",
"day": " days",
"nacos.page.configurationManagement.please_input_the_application_name": "Enter app name",
"nacos.component.ImportDialog.file_upload_directly_after_importing_the_configuration,_please_be_sure_to_exercise_caution7": "Caution: data will be imported directly after uploading.",
"com.alibaba.nacos.page.configurationManagement.delete": "Delete",
"com.alibaba.nacos.component.SuccessDialog.Configuration_management": "Configuration Management",
"com.alibaba.nacos.page.configRollback.updated": "Update",
"com.alibaba.nacos.page.configRollback.determine": "Are you sure you want to roll back",
"nacos.component.DeleteDialog.deleted_successfully_configured": "Configuration deleted",
"nacos.page.configurationManagement.export_check_failed": "Export check failed.",
"com.alibaba.nacos.page.configeditor.configcontent": "Configuration Content",
"nacos.page.namespace.AccessKey_recommended0": "AccessKey recommended:",
"nacos.page.namespace.region_ID": "Region ID:",
"com.alibaba.nacos.component.NewNameSpace.norepeat": "Duplicate namespace. Please enter a different name.",
"com.alibaba.nacos.component.EditorNameSpace.load": "Namespace:",
"com.alibaba.nacos.page.configurationManagement.version": "Historical Versions",
"com.alibaba.nacos.page.namespace.operation": "Actions",
"com.alibaba.nacos.page.newconfig": "Data ID cannot be empty.",
"nacos.component.validateDialog.verification_code_error": "verification code error",
"nacos.page.namespace.remove_the_namespace": "Remove the namespace",
"com.alibaba.nacos.component.MiddleWareEnv.performance": "Performance",
"nacos.page.namespace.note_ACM_is_dedicated_AK/SK_is_mainly_used_for_some_of_the_compatibility_s": "note: ACM is dedicated AK/SK is mainly used for some of the compatibility scenario, it is recommended to Unified the use of Ali cloud AK/SK.",
"nacos.component.ExportDialog.|_The_selected_entry0": "| Selected Entry",
"com.alibaba.nacos.component.EditorNameSpace.confirm_modify": "Edit Namespace",
"com.alibaba.nacos.page.newconfig.do_not_ente": "Illegal characters not allowed",
"nacos.page.newconfig.Data_encryption0": "Data encryption",
"nacos.component.ShowCodeing.,_6000);_System.out.println(content);_//_初始化的时候给配置添加监听,配置变更会回调通知_ConfigService.addListener(": "\", 6000);\t\t\tSystem.out.println(content);\t\t\t// 初始化的时候,给配置添加监听,配置变更会回调通知\t\t\tConfigService.addListener(\"",
"nacos.page.configurationManagement.Clone_failed": "Clone failed",
"com.alibaba.nacos.page.configdetail.return": "Back",
"com.alibaba.nacos.page.configeditor.stop_beta": "Stop Beta Publishing",
"com.alibaba.nacos.component.NewNameSpace.input": "Illegal characters not allowed",
"nacos.page.configurationManagement.Tags": "Tags:",
"com.alibaba.nacos.page.pushTrajectory.cluster_synchronization": "Synchronization across Clusters ",
"nacos.page.namespace.ecs_ram_role": "Automatically issued the AccessKey and SecretKey (Recommended for production environment):",
"nacos.page.configurationManagement.whether_to_delete_the_selected": "Are you sure to delete the selected",
"nacos.page.configeditor.Tags": "Tags:",
"com.alibaba.nacos.page.newconfig.stop_beta": "Stop Beta Publishing",
"nacos.component.NameSpaceList.Announcement_nodejs_version_is_developed,supports_a_custom_message": "Announcement: Node.js version now available, supporting customized messages.",
"nacos.page.configurationManagement.bulk_delete": "Delete",
"com.alibaba.nacos.page.serviceManagement.service_list": "Service List",
"com.alibaba.nacos.page.serviceManagement.service_name": "Service Name",
"com.alibaba.nacos.page.serviceManagement.please_enter_the_service_name": "Enter Service Name",
"com.alibaba.nacos.page.serviceManagement.query": "Search",
"serviceManagement": "Service Management"
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,51 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Nacos</title>
<link rel="shortcut icon" href="//www.aliyun.com/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="//g.alicdn.com/aliyun/console-base/0.0.18/app.css">
<link rel="stylesheet" type="text/css" href="//g.alicdn.com/aliyun/console/1.3.63/styles/bootstrap/bootstrap.css">
<link rel="stylesheet" type="text/css" href="//g.alicdn.com/aliyun/console/1.3.63/styles/console1412.css">
<link rel="stylesheet" type="text/css" href="//g.alicdn.com/cm/edas/2.132.6/styles/edas/edas.console.css">
<!-- 第三方css开始 -->
<link rel="stylesheet" type="text/css" href="//g.alicdn.com/EFDP/naruto-cdn/0.0.52/naruto/lib/codemirror.css">
<link rel="stylesheet" type="text/css" href="//g.alicdn.com/EFDP/naruto-cdn/0.0.52/naruto/lib/merge.css">
<link rel="stylesheet" type="text/css" href="//g.alicdn.com/EFDP/naruto-cdn/0.0.52/naruto/lib/bootstrap.css">
<link rel="stylesheet" type="text/css" href="//g.alicdn.com/cm-design/simpleMVC/public/styles/icons/icon.css">
<link rel="stylesheet" type="text/css" href="//g.alicdn.com/EFDP/naruto-cdn/0.0.52/naruto/lib/font-awesome.css">
<link rel="stylesheet" type="text/css" href="index.css">
<!-- 第三方css结束 -->
<script src="//g.alicdn.com/cm-design/simplemvc-cdn/0.0.67/jquery.js"></script>
<!-- i18nJs开始 -->
<script src="i18ndoc.js"></script>
<!-- i18nJs结束 -->
</head>
<body>
<div id="root" style="overflow:hidden"></div>
<div id="app"></div>
<div id="other"></div>
<!-- 第三方js开始 -->
<script src="//g.alicdn.com/EFDP/naruto-cdn/0.0.64/naruto/lib/codemirror.js"></script>
<script src="//g.alicdn.com/EFDP/naruto-cdn/0.0.52/naruto/lib/javascript.js"></script>
<script src="//g.alicdn.com/EFDP/naruto-cdn/0.0.52/naruto/lib/xml.js"></script>
<script src="//g.alicdn.com/EFDP/naruto-cdn/0.0.52/naruto/lib/codemirror.addone.fullscreen.js"></script>
<script src="//g.alicdn.com/EFDP/naruto-cdn/0.0.52/naruto/lib/codemirror.addone.lint.js"></script>
<script src="//g.alicdn.com/EFDP/naruto-cdn/0.0.52/naruto/lib/codemirror.lib.json-lint.js"></script>
<script src="//g.alicdn.com/EFDP/naruto-cdn/0.0.52/naruto/lib/codemirror.addone.json-lint.js"></script>
<script src="//g.alicdn.com/EFDP/naruto-cdn/0.0.52/naruto/lib/codemirror.lib.clike-lint.js"></script>
<script src="//g.alicdn.com/EFDP/naruto-cdn/0.0.52/naruto/lib/diff_match_patch.js"></script>
<script src="//g.alicdn.com/EFDP/naruto-cdn/0.0.52/naruto/lib/merge.js"></script>
<script src="//g.alicdn.com/EFDP/naruto-cdn/0.0.52/naruto/lib/loader.js"></script>
<!-- 第三方js结束 -->
<script src="index.js"></script>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,34 @@
{
"private": true,
"scripts": {
"start": "roadhog dev",
"build": "node build.js",
"dist": "roadhog build",
"lint": "eslint --ext .js src test"
},
"dependencies": {
"@alifd/next": "^1.7.6",
"dva": "^2.3.1",
"jquery": "^3.3.1",
"moment": "^2.22.2",
"prop-types": "^15.6.2",
"react": "^16.2.0",
"react-dom": "^16.2.0"
},
"devDependencies": {
"babel-core": "^6.26.3",
"babel-plugin-dva-hmr": "^0.3.2",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "^1.3.5",
"babel-preset-stage-2": "^6.24.1",
"eslint": "^4.14.0",
"eslint-config-umi": "^0.1.1",
"eslint-plugin-flowtype": "^2.34.1",
"eslint-plugin-import": "^2.6.0",
"eslint-plugin-jsx-a11y": "^5.1.1",
"eslint-plugin-react": "^7.1.0",
"husky": "^0.12.0",
"roadhog": "^2.0.0"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,51 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Nacos</title>
<link rel="shortcut icon" href="//www.aliyun.com/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="//g.alicdn.com/aliyun/console-base/0.0.18/app.css">
<link rel="stylesheet" type="text/css" href="//g.alicdn.com/aliyun/console/1.3.63/styles/bootstrap/bootstrap.css">
<link rel="stylesheet" type="text/css" href="//g.alicdn.com/aliyun/console/1.3.63/styles/console1412.css">
<link rel="stylesheet" type="text/css" href="//g.alicdn.com/cm/edas/2.132.6/styles/edas/edas.console.css">
<!-- 第三方css开始 -->
<link rel="stylesheet" type="text/css" href="//g.alicdn.com/EFDP/naruto-cdn/0.0.52/naruto/lib/codemirror.css">
<link rel="stylesheet" type="text/css" href="//g.alicdn.com/EFDP/naruto-cdn/0.0.52/naruto/lib/merge.css">
<link rel="stylesheet" type="text/css" href="//g.alicdn.com/EFDP/naruto-cdn/0.0.52/naruto/lib/bootstrap.css">
<link rel="stylesheet" type="text/css" href="//g.alicdn.com/cm-design/simpleMVC/public/styles/icons/icon.css">
<link rel="stylesheet" type="text/css" href="//g.alicdn.com/EFDP/naruto-cdn/0.0.52/naruto/lib/font-awesome.css">
<link rel="stylesheet" type="text/css" href="index.css">
<!-- 第三方css结束 -->
<script src="//g.alicdn.com/cm-design/simplemvc-cdn/0.0.67/jquery.js"></script>
<!-- i18nJs开始 -->
<script src="i18ndoc.js"></script>
<!-- i18nJs结束 -->
</head>
<body>
<div id="root" style="overflow:hidden"></div>
<div id="app"></div>
<div id="other"></div>
<!-- 第三方js开始 -->
<script src="//g.alicdn.com/EFDP/naruto-cdn/0.0.64/naruto/lib/codemirror.js"></script>
<script src="//g.alicdn.com/EFDP/naruto-cdn/0.0.52/naruto/lib/javascript.js"></script>
<script src="//g.alicdn.com/EFDP/naruto-cdn/0.0.52/naruto/lib/xml.js"></script>
<script src="//g.alicdn.com/EFDP/naruto-cdn/0.0.52/naruto/lib/codemirror.addone.fullscreen.js"></script>
<script src="//g.alicdn.com/EFDP/naruto-cdn/0.0.52/naruto/lib/codemirror.addone.lint.js"></script>
<script src="//g.alicdn.com/EFDP/naruto-cdn/0.0.52/naruto/lib/codemirror.lib.json-lint.js"></script>
<script src="//g.alicdn.com/EFDP/naruto-cdn/0.0.52/naruto/lib/codemirror.addone.json-lint.js"></script>
<script src="//g.alicdn.com/EFDP/naruto-cdn/0.0.52/naruto/lib/codemirror.lib.clike-lint.js"></script>
<script src="//g.alicdn.com/EFDP/naruto-cdn/0.0.52/naruto/lib/diff_match_patch.js"></script>
<script src="//g.alicdn.com/EFDP/naruto-cdn/0.0.52/naruto/lib/merge.js"></script>
<script src="//g.alicdn.com/EFDP/naruto-cdn/0.0.52/naruto/lib/loader.js"></script>
<!-- 第三方js结束 -->
<script src="index.js"></script>
</body>
</html>

View File

@ -0,0 +1,106 @@
import React from 'react';
import { Dialog, Pagination, Transfer } from '@alifd/next';
import './index.less';
/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/
class BatchHandle extends React.Component {
constructor(props) {
super(props);
this.state = {
visible: false,
valueList: props.valueList || [],
dataSourceList: props.dataSource || [],
currentPage: 1,
total: 0,
pageSize: 10,
dataSource: {}
};
}
componentDidMount() {}
openDialog(dataSource) {
this.setState({
visible: true,
dataSource: dataSource,
pageSize: dataSource.pageSize
}, () => {
this.getData();
console.log(this.transfer._instance.filterCheckedValue);
this.transfer._instance.filterCheckedValue = function (left, right, dataSource) {
var result = {
left: left,
right: right
};
console.log(left, right, dataSource);
// if (left.length || right.length) {
// var value = dataSource.map(function (item) {
// return item.value;
// });
// value.forEach(function (itemValue) {
// if (left.indexOf(itemValue) > -1) {
// result.left.push(itemValue);
// } else if (right.indexOf(itemValue) > -1) {
// result.right.push(itemValue);
// }
// });
// }
return result;
};
});
}
closeDialog() {
this.setState({
visible: false
});
}
getData() {
const dataSource = this.state.dataSource;
window.request({
url: `/diamond-ops/configList/serverId/${dataSource.serverId}?dataId=${dataSource.dataId}&group=${dataSource.group}&appName=${dataSource.appName}&config_tags=${dataSource.config_tags || ''}&pageNo=${this.state.currentPage}&pageSize=${dataSource.pageSize}`,
success: res => {
if (res.code === 200) {
this.setState({
dataSourceList: res.data.map(obj => {
return {
label: obj.dataId,
value: obj.dataId
};
}) || [],
total: res.total
});
}
}
});
}
changePage(currentPage) {
this.setState({
currentPage
}, () => {
this.getData();
});
}
onChange(valueList, data, extra) {
this.setState({
valueList
});
}
onSubmit() {
this.props.onSubmit && this.props.onSubmit(this.state.valueList);
}
render() {
// console.log("valueList: ", this.state.valueList, this.transfer);
return <Dialog visible={this.state.visible} language={window.pageLanguage || 'zh-cn'} style={{ width: "500px" }} onCancel={this.closeDialog.bind(this)} onClose={this.closeDialog.bind(this)} onOk={this.onSubmit.bind(this)} title={"批量操作"}>
<div>
<Transfer ref={ref => this.transfer = ref} listStyle={{ height: 350 }} dataSource={this.state.dataSourceList || []} value={this.state.valueList} onChange={this.onChange.bind(this)} language={window.pageLanguage || 'zh-cn'} />
{/* <div>
<Table dataSource={this.state.dataSourceList} language={window.aliwareIntl.currentLanguageCode}></Table>
</div> */}
<Pagination style={{ marginTop: 10 }} current={this.state.currentPage} language={window.pageLanguage || 'zh-cn'} total={this.state.total} pageSize={this.state.pageSize} onChange={this.changePage.bind(this)} type="simple" />
</div>
</Dialog>;
}
}
/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/
export default BatchHandle;

View File

@ -0,0 +1,3 @@
import BatchHandle from './BatchHandle';
export default BatchHandle;

View File

@ -0,0 +1,174 @@
import React from 'react';
import './index.less';
import { Button, Dialog, Field, Form, Select } from '@alifd/next';
const FormItem = Form.Item;
const { AutoComplete: Combobox } = Select;
/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/
class CloneDialog extends React.Component {
constructor(props) {
super(props);
this.allPolicy = [{ value: 'abort', label: window.aliwareIntl.get('nacos.component.CloneDialog.Terminate_the_clone0') }, { value: 'skip', label: window.aliwareIntl.get('nacos.component.CloneDialog.skip') }, { value: 'overwrite', label: window.aliwareIntl.get('nacos.component.CloneDialog.cover') }];
this.defaultPolicy = 'abort';
this.state = {
visible: false,
serverId: '',
tenantFrom: {},
tenantTo: '',
dataId: '',
group: '',
appName: '',
configTags: '',
records: [],
namespaces: [],
policy: this.defaultPolicy,
policyLabel: window.aliwareIntl.get('nacos.component.CloneDialog.Terminate_the_clone0'),
total: 0
};
this.field = new Field(this);
this.formItemLayout = {
labelCol: {
fixedSpan: 6
},
wrapperCol: {
span: 18
}
};
}
componentDidMount() {}
openDialog(payload, callback) {
let serverId = window.getParams('serverId') || 'center';
this.checkData = payload.checkData;
this.callback = callback;
window.request({
type: 'get',
url: `/diamond-ops/service/serverId/${serverId}/namespaceInfo`,
success: res => {
if (res.code === 200) {
let dataSource = [];
res.data.forEach(value => {
if (value.namespace !== payload.tenantFrom.id) {
dataSource.push({
value: value.namespace,
label: value.namespaceShowName + " | " + value.namespace
});
}
});
this.setState({
visible: true,
serverId: payload.serverId,
tenantFrom: payload.tenantFrom,
tenantTo: '',
dataId: payload.dataId,
group: payload.group,
appName: payload.appName,
configTags: payload.configTags,
records: payload.records,
namespaces: dataSource,
total: payload.total
});
this.field.setValue('select', '');
} else {
Dialog.alert({
language: window.pageLanguage || 'zh-cn',
title: window.aliwareIntl.get('nacos.component.CloneDialog.get_the_namespace_failed'),
content: res.message
});
}
}
});
}
closeDialog() {
this.setState({
visible: false
});
}
setTenantTo(value) {
this.field.setValue(value);
this.setState({
tenantTo: value
});
}
setPolicy(...value) {
this.setState({
policyLabel: value[1].label,
policy: value[0]
});
}
getQuery() {
if (this.state.records.length > 0) {
return window.aliwareIntl.get('nacos.component.CloneDialog.|_the_selected_entry4');
}
if (this.state.dataId === '' && this.state.group === '' && this.state.appName === '' && this.state.configTags.length === 0) {
return '';
}
let query = " |";
if (this.state.dataId !== '') {
query += ' DataId: ' + this.state.dataId + ',';
}
if (this.state.group !== '') {
query += ' Group: ' + this.state.group + ',';
}
if (this.state.appName !== '') {
query += window.aliwareIntl.get('nacos.component.CloneDialog.HOME_Application') + this.state.appName + ',';
}
if (this.state.configTags.length !== 0) {
query += window.aliwareIntl.get('nacos.component.CloneDialog.tags') + this.state.configTags + ',';
}
return query.substr(0, query.length - 1);
}
doClone() {
this.field.validate((errors, values) => {
if (errors) {
return;
}
this.closeDialog();
this.checkData.tenantTo = this.state.tenantTo;
this.checkData.policy = this.state.policy;
this.callback(this.checkData, this.state.policyLabel);
});
}
render() {
const init = this.field.init;
const footer = <div><Button type="primary" onClick={this.doClone.bind(this)} {...{ "disabled": this.state.total <= 0 }}>{window.aliwareIntl.get('nacos.component.CloneDialog.start_cloning')}</Button>
</div>;
return <div>
<Dialog visible={this.state.visible} footer={footer} footerAlign="center" language={window.pageLanguage || 'zh-cn'} style={{ width: 555 }} onCancel={this.closeDialog.bind(this)} onClose={this.closeDialog.bind(this)} title={window.aliwareIntl.get('nacos.component.CloneDialog.configuration_cloning\uFF08') + this.state.serverId + ""}>
<Form field={this.field}>
<FormItem label={window.aliwareIntl.get('nacos.component.CloneDialog.source_space')} {...this.formItemLayout}>
<p><span style={{ color: '#33cde5' }}>{this.state.tenantFrom.name}</span>{" | " + this.state.tenantFrom.id}
</p>
</FormItem>
<FormItem label={window.aliwareIntl.get('nacos.component.CloneDialog.configuration_number')} {...this.formItemLayout}>
<p><span style={{ color: '#33cde5' }}>{this.state.total}</span> {this.getQuery()} </p>
</FormItem>
<FormItem label={window.aliwareIntl.get('nacos.component.CloneDialog.target_space')} {...this.formItemLayout}>
<Combobox style={{ width: '80%' }} size="medium" hasArrow placeholder={window.aliwareIntl.get('nacos.component.CloneDialog.select_namespace')} dataSource={this.state.namespaces} {...init('select', {
props: {
onChange: this.setTenantTo.bind(this)
},
rules: [{ required: true, message: window.aliwareIntl.get('nacos.component.CloneDialog.select_namespace') }]
})} language={window.aliwareIntl.currentLanguageCode}>
</Combobox>
</FormItem>
<FormItem label={window.aliwareIntl.get('nacos.component.CloneDialog.the_same_configuration')} {...this.formItemLayout}>
<Select size="medium" hasArrow defaultValue={this.defaultPolicy} dataSource={this.allPolicy} onChange={this.setPolicy.bind(this)} language={window.aliwareIntl.currentLanguageCode}>
</Select>
</FormItem>
</Form>
</Dialog>
</div>;
}
}
/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/
export default CloneDialog;

View File

@ -0,0 +1,3 @@
import CloneDialog from './CloneDialog';
export default CloneDialog;

View File

@ -0,0 +1,74 @@
import React from 'react';
import './index.less';
import { Button,Dialog, Grid, Icon } from '@alifd/next';
const { Row, Col } = Grid;
/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/
class DeleteDialog extends React.Component {
constructor(props) {
super(props);
this.state = {
visible: false,
title: window.aliwareIntl.get('nacos.component.DeleteDialog.Configuration_management'),
content: '',
isok: true,
dataId: '',
group: ''
};
}
componentDidMount() {}
openDialog(payload) {
this.setState({
visible: true,
title: payload.title,
content: payload.content,
isok: payload.isok,
dataId: payload.dataId,
group: payload.group,
message: payload.message
});
}
closeDialog() {
this.setState({
visible: false
});
}
render() {
const footer = <div style={{ textAlign: 'right' }}><Button type="primary" onClick={this.closeDialog.bind(this)}>{window.aliwareIntl.get('nacos.component.DeleteDialog.determine')}</Button></div>;
return <div>
<Dialog visible={this.state.visible} footer={footer} language={window.pageLanguage || 'zh-cn'} style={{ width: 555 }} onCancel={this.closeDialog.bind(this)} onClose={this.closeDialog.bind(this)} title={window.aliwareIntl.get('nacos.component.DeleteDialog.deletetitle')}>
<div>
<Row>
<Col span={'4'} style={{ paddingTop: 16 }}>
{this.state.isok ? <Icon type="success-filling" style={{ color: 'green' }} size={'xl'} /> : <Icon type="delete-filling" style={{ color: 'red' }} size={'xl'} />}
</Col>
<Col span={'20'}>
<div>
<h3>{this.state.isok ? window.aliwareIntl.get('nacos.component.DeleteDialog.deleted_successfully_configured') : window.aliwareIntl.get('nacos.component.DeleteDialog.delete_the_configuration_failed')}</h3>
<p>
<span style={{ color: '#999', marginRight: 5 }}>Data ID:</span>
<span style={{ color: '#c7254e' }}>
{this.state.dataId}
</span>
</p>
<p>
<span style={{ color: '#999', marginRight: 5 }}>Group:</span>
<span style={{ color: '#c7254e' }}>
{this.state.group}
</span>
</p>
{this.state.isok ? '' : <p style={{ color: 'red' }}>{this.state.message}</p>}
</div>
</Col>
</Row>
</div>
</Dialog>
</div>;
}
}
/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/
export default DeleteDialog;

View File

@ -0,0 +1,3 @@
import DeleteDialog from './DeleteDialog';
export default DeleteDialog;

View File

@ -0,0 +1,75 @@
import React from 'react';
import './index.less';
import { Button, Dialog, Grid } from '@alifd/next';
const { Row, Col } = Grid;
/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/
class DiffEditorDialog extends React.Component {
constructor(props) {
super(props);
this.state = {
dialogvisible: false
};
}
componentDidMount() {}
openDialog(letfcode, rightcode) {
this.setState({
dialogvisible: true
});
setTimeout(() => {
this.createDiffCodeMirror(letfcode, rightcode);
});
}
closeDialog() {
this.setState({
dialogvisible: false
});
}
createDiffCodeMirror(leftCode, rightCode) {
let target = this.refs["diffeditor"];
target.innerHTML = '';
this.diffeditor = window.CodeMirror.MergeView(target, {
value: leftCode || '',
readOnly: true,
origLeft: null,
orig: rightCode || '',
lineNumbers: true,
mode: this.mode,
theme: 'xq-light',
highlightDifferences: true,
connect: 'align',
collapseIdentical: false
});
// this.diffeditor.leftOriginal().setSize(null,480);
// this.diffeditor.rightOriginal().setSize(null, 480);
// this.diffeditor.wrap.style.height= '480px';
// this.diffeditor.edit.setSize('100%',480);
// this.diffeditor.right.edit.setSize('100%',480);
}
confirmPub() {
this.closeDialog();
this.props.publishConfig();
}
render() {
const footer = <div> <Button type="primary" onClick={this.confirmPub.bind(this)}>{window.aliwareIntl.get('com.alibaba.nacos.component.DiffEditorDialog.confirm_that_the')}</Button></div>;
return <div>
<Dialog title={window.aliwareIntl.get('com.alibaba.nacos.component.DiffEditorDialog.contents')} language={window.pageLanguage || 'zh-cn'} style={{ width: '80%' }} visible={this.state.dialogvisible} footer={footer} onClose={this.closeDialog.bind(this)}>
<div style={{ height: 400 }}>
<div>
<Row>
<Col style={{ textAlign: 'center' }}>{window.aliwareIntl.get('com.alibaba.nacos.component.DiffEditorDialog.of_the_current_area')}</Col>
<Col style={{ textAlign: 'center' }}>{window.aliwareIntl.get('com.alibaba.nacos.component.DiffEditorDialog.original_value')}</Col>
</Row>
</div>
<div style={{ clear: 'both', height: 480 }} ref="diffeditor"></div>
</div>
</Dialog>
</div>;
}
}
/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/
export default DiffEditorDialog;

View File

@ -0,0 +1,3 @@
import DiffEditorDialog from './DiffEditorDialog';
export default DiffEditorDialog;

View File

@ -0,0 +1,170 @@
import React from 'react';
import './index.less';
import { Button, Dialog, Field, Form, Input, Loading } from '@alifd/next';
const FormItem = Form.Item;
/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/
class EditorNameSpace extends React.Component {
constructor(props) {
super(props);
this.state = {
dialogvisible: false,
loading: false
};
this.field = new Field(this);
}
componentDidMount() {
}
openDialog(record) {
this.getNamespaceDetail(record);
this.setState({
dialogvisible: true,
type: record.type
});
}
closeDialog() {
this.setState({
dialogvisible: false
});
}
openLoading() {
this.setState({
loading: true
});
}
closeLoading() {
this.setState({
loading: false
});
}
getNamespaceDetail(record){
this.field.setValues(record);
window.request({
type: 'get',
url: `/nacos/v1/console/namespaces?show=all&namespaceId=${record.namespace}`,
success: res => {
if (res !== null) {
this.field.setValue('namespaceDesc', res.namespaceDesc);
} else {
Dialog.alert({
language: window.pageLanguage || 'zh-cn',
title: window.aliwareIntl.get('com.alibaba.nacos.component.NameSpaceList.Prompt'),
content: res.message
});
}
},
error: res => {
window.namespaceList = [];
this.handleNameSpaces(window.namespaceList);
}
});
}
handleSubmit() {
this.field.validate((errors, values) => {
if (errors) {
return;
}
window.request({
type: 'put',
beforeSend: () => {
this.openLoading();
},
url: `/nacos/v1/console/namespaces`,
contentType: 'application/x-www-form-urlencoded',
data: {
"namespace":values.namespace,
"namespaceShowName":values.namespaceShowName,
"namespaceDesc":values.namespaceDesc
},
success: res => {
if (res === true) {
this.closeDialog();
this.props.getNameSpaces();
this.refreshNameSpace(); //刷新全局namespace
} else {
Dialog.alert({
language: window.pageLanguage || 'zh-cn',
title: window.aliwareIntl.get('com.alibaba.nacos.component.EditorNameSpace.prompt'),
content: res.message
});
}
},
complete: () => {
this.closeLoading();
}
});
});
}
refreshNameSpace() {
setTimeout(() => {
window.request({
type: 'get',
url: `/nacos/v1/console/namespaces`,
success: res => {
if (res.code === 200) {
window.namespaceList = res.data;
}
}
});
}, 2000);
}
validateChart(rule, value, callback) {
const chartReg = /[@#\$%\^&\*]+/g;
if (chartReg.test(value)) {
callback(window.aliwareIntl.get('com.alibaba.nacos.component.EditorNameSpace.please_do'));
} else {
callback();
}
}
render() {
const formItemLayout = {
labelCol: {
fixedSpan: 6
},
wrapperCol: {
span: 18
}
};
let footer = this.state.type === 0 ? <div></div> : <Button type="primary" onClick={this.handleSubmit.bind(this)}>{window.aliwareIntl.get('com.alibaba.nacos.component.EditorNameSpace.public_space')}</Button>;
return (
<div>
<Dialog title={window.aliwareIntl.get('com.alibaba.nacos.component.EditorNameSpace.confirm_modify')} style={{ width: '50%' }} visible={this.state.dialogvisible} footer={footer} onCancel={this.closeDialog.bind(this)} onClose={this.closeDialog.bind(this)} language={window.aliwareIntl.currentLanguageCode}>
<Loading tip={window.aliwareIntl.get('com.alibaba.nacos.component.EditorNameSpace.edit_namespace')} style={{ width: '100%', position: 'relative' }} visible={this.state.loading}>
<Form field={this.field}>
<FormItem label={window.aliwareIntl.get('com.alibaba.nacos.component.EditorNameSpace.load')} required {...formItemLayout}>
<Input {...this.field.init('namespaceShowName', {
rules: [{
required: true,
message: window.aliwareIntl.get('com.alibaba.nacos.component.EditorNameSpace.namespace')
}, { validator: this.validateChart.bind(this) }]
})} disabled={this.state.type === 0 ? true : false} />
</FormItem>
<FormItem label={window.aliwareIntl.get('nacos.page.configdetail.Description')} required {...formItemLayout}>
<Input {...this.field.init('namespaceDesc', {
rules: [{
required: true,
message: window.aliwareIntl.get('com.alibaba.nacos.component.EditorNameSpace.namespace')
}, { validator: this.validateChart.bind(this) }]
})} disabled={this.state.type === 0 ? true : false} />
</FormItem>
</Form>
</Loading>
</Dialog>
</div>
);
}
}
/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/
export default EditorNameSpace;

View File

@ -0,0 +1,3 @@
import EditorNameSpace from './EditorNameSpace';
export default EditorNameSpace;

View File

@ -0,0 +1,120 @@
import React from 'react';
import './index.less';
import { Button, Dialog, Form } from '@alifd/next';
const FormItem = Form.Item;
/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/
class ExportDialog extends React.Component {
constructor(props) {
super(props);
this.state = {
visible: false,
serverId: '',
tenant: '',
dataId: '',
group: '',
appName: '',
configTags: '',
records: [],
total: 0
};
this.formItemLayout = {
labelCol: {
fixedSpan: 4
},
wrapperCol: {
span: 20
}
};
}
componentDidMount() {}
openDialog(payload) {
this.setState({
visible: true,
serverId: payload.serverId,
tenant: payload.tenant,
dataId: payload.dataId,
group: payload.group,
appName: payload.appName,
configTags: payload.configTags,
records: payload.records,
total: payload.total
});
}
closeDialog() {
this.setState({
visible: false
});
}
getQuery() {
if (this.state.records.length > 0) {
return window.aliwareIntl.get('nacos.component.ExportDialog.|_The_selected_entry0');
}
if (this.state.dataId === '' && this.state.group === '' && this.state.appName === '' && this.state.configTags.length === 0) {
return '';
}
let query = " |";
if (this.state.dataId !== '') {
query += ' DataId: ' + this.state.dataId + ',';
}
if (this.state.group !== '') {
query += ' Group: ' + this.state.group + ',';
}
if (this.state.appName !== '') {
query += window.aliwareIntl.get('nacos.component.ExportDialog.HOME_Application1') + this.state.appName + ',';
}
if (this.state.configTags.length !== 0) {
query += window.aliwareIntl.get('nacos.component.ExportDialog.tags2') + this.state.configTags + ',';
}
return query.substr(0, query.length - 1);
}
doExport() {
// document.getElementById('downloadLink').click();
let url = this.getLink();
window.open(url);
this.closeDialog();
}
getLink() {
let data = [];
this.state.records.forEach(record => {
data.push({ dataId: record.dataId, group: record.group });
});
console.log(encodeURI(JSON.stringify(data)));
let query = `?dataId=${this.state.dataId}&group=${this.state.group}&appName=${this.state.appName}&tags=${this.state.configTags || ''}&data=${encodeURI(JSON.stringify(data))}`;
const baseLink = `/diamond-ops/batch/export/serverId/${this.state.serverId}/tenant/${this.state.tenant.id}` + query;
if (window.globalConfig.isParentEdas()) {
return '/authgw/'+ window.edasprefix + baseLink;
}
return baseLink;
}
render() {
const footer = <div>
{/* <a id="downloadLink" style={{ display: "none" }} href={this.getLink()} /> */}
<Button type="primary" onClick={this.doExport.bind(this)} {...{ "disabled": this.state.total <= 0 }}>{window.aliwareIntl.get('nacos.component.ExportDialog.export3')}</Button>
</div>;
return <div>
<Dialog visible={this.state.visible} footer={footer} footerAlign="center" language={window.pageLanguage || 'zh-cn'} style={{ width: 480 }} onCancel={this.closeDialog.bind(this)} onClose={this.closeDialog.bind(this)} title={window.aliwareIntl.get('nacos.component.ExportDialog.export_configuration4') + this.state.serverId + ""}>
<Form>
<FormItem label={window.aliwareIntl.get('nacos.component.ExportDialog.source_space5')} {...this.formItemLayout}>
<p>
<span style={{ color: '#33cde5' }}>{this.state.tenant.name}</span>{" | " + this.state.tenant.id}
</p>
</FormItem>
<FormItem label={window.aliwareIntl.get('nacos.component.ExportDialog.configuration_number6')} {...this.formItemLayout}>
<p><span style={{ color: '#33cde5' }}>{this.state.total}</span> {this.getQuery()} </p>
</FormItem>
</Form>
</Dialog>
</div>;
}
}
/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/
export default ExportDialog;

View File

@ -0,0 +1,3 @@
import ExportDialog from './ExportDialog';
export default ExportDialog;

View File

@ -0,0 +1,111 @@
import React from 'react';
import './index.less';
import { Balloon, Button, Dialog, Form, Icon, Select, Upload } from '@alifd/next';
const FormItem = Form.Item;
/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/
class ImportDialog extends React.Component {
constructor(props) {
super(props);
this.formItemLayout = {
labelCol: {
fixedSpan: 4
},
wrapperCol: {
span: 20
}
};
this.allPolicy = [{ value: 'abort', label: window.aliwareIntl.get('nacos.component.ImportDialog.To_terminate_the_import0') }, { value: 'skip', label: window.aliwareIntl.get('nacos.component.ImportDialog.skip1') }, {
value: 'overwrite',
label: window.aliwareIntl.get('nacos.component.ImportDialog.cover2')
}];
this.defaultPolicy = 'abort';
this.state = {
visible: false,
serverId: '',
tenant: '',
policy: this.defaultPolicy,
policyLabel: window.aliwareIntl.get('nacos.component.ImportDialog.To_terminate_the_import0')
};
}
componentDidMount() {}
openDialog(payload, callback) {
this.callback = callback;
this.setState({
visible: true,
serverId: payload.serverId,
tenant: payload.tenant
});
}
closeDialog() {
this.setState({
visible: false
});
}
setPolicy(...value) {
this.setState({
policyLabel: value[1].label,
policy: value[0]
});
}
formatter(res) {
if (res.code === 200) {
return {
code: '0',
retData: res
};
} else {
return {
code: '1',
error: {
message: res.message
},
retData: res
};
}
}
render() {
let uploadLink = `/diamond-ops/batch/import/serverId/${this.state.serverId}/tenant/${this.state.tenant.id}?policy=${this.state.policy}`;
if (window.globalConfig.isParentEdas()) {
uploadLink = '/authgw/' + window.edasprefix + uploadLink;
}
const helpTip = <Balloon trigger={<span>Data ID <Icon type={"help"} size={'small'} style={{ color: '#1DC11D', marginRight: 5, verticalAlign: 'middle' }} /></span>} align={"t"} style={{ marginRight: 5 }} triggerType={"hover"}>
<a href={window._getLink && window._getLink("knowDataid")} target={"_blank"}>{window.aliwareIntl.get('nacos.component.ImportDialog.You_can_only_upload._zip_file_format0') /*只能上传.zip格式的文件*/}</a>
</Balloon>;
const footer = <div><Upload language={window.pageLanguage || 'zh-cn'} listType={"text"} action={uploadLink} limit={1} accept={".zip"} onSuccess={(...args) => {
this.callback(args[0].retData, this.state.policyLabel);
this.closeDialog();
}} onError={(...args) => {
this.callback(args[0].response.retData, this.state.policyLabel);
this.closeDialog();
}} formatter={this.formatter.bind(this)} headers={{ poweredBy: "simpleMVC", projectName: "nacos" }}>
<Button type={"primary"}>{window.aliwareIntl.get('nacos.component.ImportDialog.Upload_File3')}</Button>
</Upload></div>;
return <div>
<Dialog visible={this.state.visible} footer={footer} footerAlign={"center"} language={window.pageLanguage || 'zh-cn'} style={{ width: 480 }} onCancel={this.closeDialog.bind(this)} onClose={this.closeDialog.bind(this)} title={window.aliwareIntl.get('nacos.component.ImportDialog.Import_configuration4') + this.state.serverId + ""}>
<Form>
<FormItem label={window.aliwareIntl.get('nacos.component.ImportDialog.target_space5')} {...this.formItemLayout}>
<p><span style={{ color: '#33cde5' }}>{this.state.tenant.name}</span>{" | " + this.state.tenant.id}
</p>
</FormItem>
<FormItem label={window.aliwareIntl.get('nacos.component.ImportDialog.the_same_configuration6')} {...this.formItemLayout}>
<Select size={"medium"} hasArrow defaultValue={this.defaultPolicy} dataSource={this.allPolicy} onChange={this.setPolicy.bind(this)} language={window.aliwareIntl.currentLanguageCode}>
</Select>
</FormItem>
</Form>
<div style={{ textAlign: "center" }}><Icon type={"warning"} style={{ color: '#ff8a00', marginRight: 5, verticalAlign: 'middle' }} />{window.aliwareIntl.get('nacos.component.ImportDialog.file_upload_directly_after_importing_the_configuration,_please_be_sure_to_exercise_caution7')}{helpTip}</div>
</Dialog>
</div>;
}
}
/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/
export default ImportDialog;

View File

@ -0,0 +1,3 @@
import ImportDialog from './ImportDialog';
export default ImportDialog;

View File

@ -0,0 +1,182 @@
import React from 'react';
import './index.less';
import { Dialog } from '@alifd/next';
/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/
/**
* 命名空间列表
*/
class NameSpaceList extends React.Component {
constructor(props) {
super(props);
this._namespace = window.getParams('namespace') || '';
// this._namespaceShowName = window.getParams('namespaceShowName') || '';
this.state = {
nownamespace: window.nownamespace || this._namespace || '',
namespaceList: window.namespaceList || []
// namespaceShowName: window.namespaceShowName || this._namespaceShowName || '',
// _dingdingLink: "",
// _forumLink: ""
};
}
componentDidMount() {
// this.getLink("dingding", "_dingdingLink");
// this.getLink("discuz", "_forumLink");
}
getLink(linkKey, keyName) {
if (window[keyName] === null) {
window.request({
url: "com.alibaba.nacos.service.getLink",
data: {
linkKey
},
success: res => {
if (res.code === 200) {
window[keyName] = res.data;
this.setState({
[keyName]: res.data
});
}
}
});
} else {
this.setState({
[keyName]: window[keyName]
});
}
}
// if (!this.state.namespaceList || this.state.namespaceList.length === 0) {
// this.getNameSpaces();
// } else {
// this.calleeParent();
// }
/**
切换namespace
**/
changeNameSpace(ns, nsName) {
this.setnamespace(ns || "");
window.setParams({
namespace: ns || "",
namespaceShowName: nsName
});
window.nownamespace = ns;
window.namespaceShowName = nsName;
this.calleeParent(true);
this.props.setNowNameSpace && this.props.setNowNameSpace(nsName, ns);
}
calleeParent(needclean = false) {
this.props.namespaceCallBack && this.props.namespaceCallBack(needclean);
}
getNameSpaces() {
if (window.namespaceList) {
this.handleNameSpaces(window.namespaceList);
} else {
window.request({
type: 'get',
url: `/nacos/v1/console/namespaces`,
success: res => {
if (res.code === 200) {
let edasAppId = window.getParams('edasAppId');
if (edasAppId && edasAppId !== '') {
console.log("======", edasAppId);
window.request({
type: 'get',
url: `/diamond-ops/service/namespaceId?edasAppId=${edasAppId}`,
success: res => {
this._namespace = res.data;
this.handleNameSpaces([{ namespace: res.data }]);
}
});
} else {
this.handleNameSpaces(res.data);
}
} else {
Dialog.alert({
language: window.pageLanguage || 'zh-cn',
title: window.aliwareIntl.get('com.alibaba.nacos.component.NameSpaceList.Prompt'),
content: res.message
});
}
},
error: res => {
window.namespaceList = [];
// window.namespaceList = [{
// "namespace": "",
// "namespaceShowName": "公共空间",
// "type": 0
// }];
this.handleNameSpaces(window.namespaceList);
}
});
}
}
handleNameSpaces(data) {
let nownamespace = window.getParams("namespace") || "";
// let namespaceShowName = this._namespaceShowName || data[0].namespaceShowName || '';
window.namespaceList = data;
window.nownamespace = nownamespace;
let namespaceShowName = "";
for (let i = 0; i < data.length; i++) {
if (data[i].namespace === nownamespace) {
namespaceShowName = data[i].namespaceShowName;
break;
}
}
window.namespaceShowName = namespaceShowName;
window.setParams('namespace', nownamespace || "");
// window.setParams('namespaceShowName', namespaceShowName);
this.props.setNowNameSpace && this.props.setNowNameSpace(namespaceShowName, nownamespace);
this.setState({
nownamespace: nownamespace,
namespaceList: data
});
this.calleeParent();
}
setnamespace(ns) {
this.setState({
nownamespace: ns
});
}
rendernamespace(namespaceList) {
let nownamespace = this.state.nownamespace; //获得当前namespace
let namespacesBtn = namespaceList.map((obj, index) => {
let style = obj.namespace === nownamespace ? { color: '#00C1DE', marginRight: 10, border: 'none', fontSize: 12 } : { color: '#666', marginRight: 10, border: 'none', fontSize: 12 };
return <div key={index} style={{ float: 'left', cursor: 'pointer' }}>{index === 0 ? '' : <span style={{ marginRight: 5, marginLeft: 5 }}>|</span>}<span type={"light"} style={style} onClick={this.changeNameSpace.bind(this, obj.namespace, obj.namespaceShowName)} key={index}>{obj.namespaceShowName}</span></div>;
});
return <div style={{ paddingTop: 9 }}>{namespacesBtn}</div>;
}
render() {
let namespaceList = this.state.namespaceList || [];
let title = this.props.title || '';
// const noticeStyle = {
// height: 45,
// lineHeight: '45px',
// backgroundColor: 'rgb(242, 242, 242)',
// border: '1px solid rgb(228, 228, 228)',
// padding: '0 20px',
// marginBottom: 5
// };
let namespacestyle = { marginTop: 5, marginBottom: '10px', paddingBottom: "10px", borderBottom: "1px solid #ccc" };
return <div className={namespaceList.length > 0 ? 'namespacewrapper' : ''} style={namespaceList.length > 0 ? namespacestyle : {}}>
{}
{title ? <p style={{ height: 30, lineHeight: '30px', paddingTop: 0, paddingBottom: 0, borderLeft: '2px solid #09c', float: 'left', margin: 0, paddingLeft: 10 }}>{this.props.title}</p> : ''}
<div style={{ float: 'left' }}>
{this.rendernamespace(namespaceList)}
</div>
{/**
<div style={{ color: '#00C1DE', float: 'left', height: '32px', lineHeight: '32px', paddingRight: 10 }}>
Namespace: {this.state.nownamespace}
</div>**/}
</div>;
}
}
/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/
export default NameSpaceList;

View File

@ -0,0 +1,3 @@
import NameSpaceList from './NameSpaceList';
export default NameSpaceList;

View File

@ -0,0 +1,187 @@
import React from 'react';
import './index.less';
import { Button, Dialog, Field, Form, Input, Loading } from '@alifd/next';
const FormItem = Form.Item;
/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/
class NewNameSpace extends React.Component {
constructor(props) {
super(props);
this.state = {
dialogvisible: false,
loading: false,
disabled: false,
dataSource: []
};
this.field = new Field(this);
this.disabled = false;
}
componentDidMount() {
this.groupLabel = document.getElementById('groupwrapper');
}
openDialog(dataSource) {
this.setState({
dialogvisible: true,
disabled: false,
dataSource
});
this.disabled = false;
}
closeDialog() {
this.setState({
dialogvisible: false
});
}
openLoading() {
this.setState({
loading: true
});
}
closeLoading() {
this.setState({
loading: false
});
}
showGroup() {
this.groupLabel.style.display = 'block';
}
hideGroup() {
this.groupLabel.style.display = 'none';
}
changeType(value) {
if (value === 0) {
this.showGroup();
} else {
this.hideGroup();
}
}
handleSubmit() {
this.field.validate((errors, values) => {
if (errors) {
return;
}
let flag = this.state.dataSource.every(val => {
if (val.namespaceShowName === values.namespaceShowName) {
return false;
}
return true;
});
if (!flag) {
Dialog.alert({
content: window.aliwareIntl.get('com.alibaba.nacos.component.NewNameSpace.norepeat'),
language: window.aliwareIntl.currentLanguageCode
});
return;
}
// let serverId = window.getParams('serverId') || 'daily';
this.disabled = true;
this.setState({
disabled: true
});
window.request({
type: 'post',
url: `/nacos/v1/console/namespaces`,
contentType: 'application/x-www-form-urlencoded',
beforeSend: () => {
this.openLoading();
},
data: {
namespaceName: values.namespaceShowName,
namespaceDesc: values.namespaceDesc,
},
success: res => {
this.disabled = false;
this.setState({
disabled: false
});
debugger;
if (res === true) {
this.closeDialog();
this.props.getNameSpaces();
this.refreshNameSpace(); //刷新全局namespace
} else {
Dialog.alert({
title: window.aliwareIntl.get('com.alibaba.nacos.component.NewNameSpace.prompt'),
content: res.message,
language: window.aliwareIntl.currentLanguageCode
});
}
},
complete: () => {
this.closeLoading();
}
});
});
}
refreshNameSpace() {
let serverId = window.getParams('serverId') || 'center';
setTimeout(() => {
window.request({
type: 'get',
url: `/diamond-ops/service/serverId/${serverId}/namespaceInfo`,
success: res => {
if (res.code === 200) {
window.namespaceList = res.data;
}
}
});
}, 2000);
}
validateChart(rule, value, callback) {
const chartReg = /[@#\$%\^&\*]+/g;
if (chartReg.test(value)) {
callback(window.aliwareIntl.get('com.alibaba.nacos.component.NewNameSpace.input'));
} else {
callback();
}
}
render() {
const formItemLayout = {
labelCol: {
fixedSpan: 6
},
wrapperCol: {
span: 18
}
};
let footer = <div>
<Button type="primary" onClick={this.handleSubmit.bind(this)} disabled={this.disabled}>{window.aliwareIntl.get('com.alibaba.nacos.component.NewNameSpace.confirm')}</Button>
<Button type="normal" onClick={this.closeDialog.bind(this)} style={{ marginLeft: 5 }}>{window.aliwareIntl.get('com.alibaba.nacos.component.NewNameSpace.cancel')}</Button>
</div>;
return (
<div>
<Dialog title={window.aliwareIntl.get('com.alibaba.nacos.component.NewNameSpace.newnamespce')} style={{ width: '50%' }} visible={this.state.dialogvisible} onOk={this.handleSubmit.bind(this)} onCancel={this.closeDialog.bind(this)} footer={footer} onClose={this.closeDialog.bind(this)} language={window.aliwareIntl.currentLanguageCode}><Form field={this.field}>
<Loading tip={window.aliwareIntl.get('com.alibaba.nacos.component.NewNameSpace.loading')} style={{ width: '100%', position: 'relative' }} visible={this.state.loading}>
<FormItem label={window.aliwareIntl.get('com.alibaba.nacos.component.NewNameSpace.name')} required {...formItemLayout}>
<Input {...this.field.init('namespaceShowName', {
rules: [{
required: true,
message: window.aliwareIntl.get('com.alibaba.nacos.component.NewNameSpace.namespacenotnull')
}, { validator: this.validateChart.bind(this) }]
})} style={{ width: '100%' }} />
</FormItem>
<FormItem label={window.aliwareIntl.get('nacos.page.configdetail.Description')} required {...formItemLayout}>
<Input {...this.field.init('namespaceDesc', {
rules: [{
required: true,
message: window.aliwareIntl.get('com.alibaba.nacos.component.NewNameSpace.namespacenotnull')
}, { validator: this.validateChart.bind(this) }]
})} style={{ width: '100%' }} />
</FormItem>
</Loading>
</Form>
</Dialog>
</div>
);
}
}
/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/
export default NewNameSpace;

View File

@ -0,0 +1,3 @@
import NewNameSpace from './NewNameSpace';
export default NewNameSpace;

View File

@ -0,0 +1,260 @@
import React from 'react';
import { Button } from '@alifd/next';
import $ from 'jquery';
import ValidateDialog from '../ValidateDialog';
import NameSpaceList from '../NameSpaceList';
import './index.less';
/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/
class RegionGroup extends React.Component {
constructor(props) {
super(props);
this.state = {
instanceData: [],
currRegionId: '',
url: props.url || '/diamond-ops/env/domain',
left: props.left,
right: props.right,
regionWidth: 700,
hideRegionList: false
};
this.currRegionId = '';
this.styles = {
title: {
// marginTop: '8px',
// marginBottom: '8px',
margin: 0,
lineHeight: '32px',
display: 'inline-block',
textIndent: '8px',
marginRight: '8px',
borderLeft: '2px solid #88b7E0',
fontSize: '16px'
}
};
this.nameSpaceList = null;
this.mainRef = null;
this.titleRef = null;
this.regionRef = null;
this.extraRef = null;
this.resizer = null;
this.timer = null;
this.handleResize = this.handleResize.bind(this);
this.handleAliyunNav = this.handleAliyunNav.bind(this);
!window.viewframeSetting && (window.viewframeSetting = {});
}
componentDidMount() {
//this.setRegionWidth();
window.postMessage({ type: 'CONSOLE_HAS_REGION' }, window.location)
$(".aliyun-console-regionbar").show();
$(window).bind("resize", this.handleResize);
window.addEventListener("message", this.handleAliyunNav);
this.getRegionList();
setTimeout(() => {
this.setRegionWidth();
this.handleRegionListStatus();
});
}
componentWillUnmount() {
$(window).unbind('resize', this.handleResize);
window.postMessage({ type: 'CONSOLE_HIDE_REGION' }, window.location)
$(".aliyun-console-regionbar").hide();
}
UNSAFE_componentWillReceiveProps(nextProps) {
this.setState({
url: nextProps.url,
left: nextProps.left,
right: nextProps.right
});
}
handleAliyunNav(event) {
const type = event.data.type;
const payload = event.data.payload; // { fromRegionId: 'xxx', toRegionId: 'xxx'' }
console.log(type, payload);
switch (type) {
case "TOPBAR_SIDEBAR_DID_MOUNT":
// this.getRegionList();
this.handleRegionListStatus();
this.changeRegionBarRegionId(this.currRegionId);
setTimeout(() => {
this.changeRegionBarRegionId(this.currRegionId);
}, 1000);
break;
case "CONSOLE_REGION_CHANGE":
this.changeTableData(payload.toRegionId);
break;
default:
break;
}
}
handleRegionListStatus() {
const isPrivateClound = window.globalConfig && window.globalConfig.isParentEdas();
this.setState({
hideRegionList: isPrivateClound ? false : window.location.search.indexOf("hideTopbar=") === -1
}, () => {
this.setRegionWidth();
});
}
handleResize() {
clearTimeout(this.timer);
this.timer = setTimeout(() => {
this.setRegionWidth();
}, 100);
}
setRegionWidth() {
try {
let mainWidth = $(this.mainRef).width();
let titleWidth = $(this.titleRef).width();
let extraWidth = $(this.extraRef).width();
let regionWidth = mainWidth - extraWidth - titleWidth - 50;
this.setState({
regionWidth: regionWidth > 100 ? regionWidth : 100
});
} catch (error) { }
}
getRegionList() {
if (window._regionList) {
console.log('...');
this.handleRegionList(window._regionList);
} else {
// TODO
this.nameSpaceList && this.nameSpaceList.getNameSpaces();
window.request({
url: this.state.url,
data: {},
success: res => {
//this.loading(false);
if (res && res.data) {
window._regionList = res.data;
this.handleRegionList(res.data);
}
}
});
}
}
handleRegionList(data) {
let envcontent = '';
let envGroups = data.envGroups;
// let serverId = window.getParams('serverId') || '';
let instanceData = [];
for (let i = 0; i < envGroups.length; i++) {
let obj = envGroups[i].envs || [];
instanceData = obj;
for (let j = 0; j < obj.length; j++) {
if (obj[j].active) {
envcontent = obj[j].serverId;
}
}
}
this.currRegionId = envcontent || instanceData[0] && instanceData[0].serverId;
window.setParam("serverId", this.currRegionId);
this.setRegionBarRegionList(instanceData, this.currRegionId);
this.changeRegionBarRegionId(this.currRegionId);
setTimeout(() => {
this.changeRegionBarRegionId(this.currRegionId);
}, 1000);
this.nameSpaceList && this.nameSpaceList.getNameSpaces();
this.setState({
currRegionId: envcontent,
instanceData: instanceData
});
}
changeTableData(serverId) {
console.log(serverId);
console.log(this.state.currRegionId);
window.setParam("serverId", serverId);
if (this.state.currRegionId === serverId) {
return;
}
this.currRegionId = serverId;
let instanceData = this.state.instanceData,
inEdas = false;
if (window.globalConfig.isParentEdas()) {
inEdas = true;
}
instanceData.forEach(obj => {
if (obj.serverId === serverId) {
let lastHash = window.location.hash.split("?")[0];
if (inEdas) {
window.setParam("serverId", obj.serverId);
// window.setParam('regionId', obj.serverId);
let url = window.location.href;
console.log("url: ", url);
window.location.href = url;
} else {
let url = obj.domain + window.location.search + lastHash;
if (lastHash.indexOf('serverId') === -1) {
if (lastHash.indexOf('?') === -1) {
url += '?serverId=' + serverId;
} else {
url += '&serverId=' + serverId;
}
}
window.location.href = window.location.protocol + '//' + url;
}
return;
}
});
//window.location.href = '';
// return;
// window.setParam("serverId", serverId);
// this.setState({
// currRegionId: serverId
// });
// this.currRegionId = serverId;
// this.props.onChange && this.props.onChange({
// instanceData: this.state.instanceData,
// currRegionId: serverId
// })
}
setRegionBarRegionList(regionList, regionId) {
// regionList = [{
// serverId: "cn-hangzhou",
// }, {
// serverId: "cn-shenzhen",
// }]
// if (!window.viewframeSetting.regionList || window.viewframeSetting.regionList.length === 0) {
if (window.viewframeSetting) {
window.viewframeSetting.regionList = regionList;
window.postMessage({ type: 'TOGGLE_REGIONBAR_STATUS', payload: { regionList: regionList, defaultRegionId: regionId } }, window.location);
}
}
changeRegionBarRegionId(regionId) {
window.viewframeSetting && (window.viewframeSetting.defaultRegionId = regionId);
window.postMessage({ type: 'SET_ACTIVE_REGION_ID', payload: { defaultRegionId: regionId } }, window.location);
}
render() {
return <div>
<ValidateDialog />
<div ref={ref => this.mainRef = ref} className="clearfix" >
<div style={{ overflow: "hidden" }}>
<div id="left" style={{ float: 'left', display: 'inline-block', marginRight: 20 }}>
<div ref={ref => this.titleRef = ref} style={{ display: 'inline-block', verticalAlign: 'top' }}>
{typeof this.state.left === 'string' ? <h5 style={this.styles.title}>{this.state.left}</h5> : this.state.left}
</div>
{this.state.hideRegionList ? null : <div ref={ref => this.regionRef = ref} style={{ width: this.state.regionWidth, display: 'inline-block', lineHeight: '40px', marginLeft: 20 }}>
{this.state.instanceData.map((val, key) => {
return <Button key={val.serverId} type={this.state.currRegionId === val.serverId ? "primary" : "normal"} style={{ fontSize: '12px', marginRight: 10, backgroundColor: this.state.currRegionId === val.serverId ? '#546478' : '#D9DEE4' }} onClick={this.changeTableData.bind(this, val.serverId)}> {val.name} </Button>;
})}
</div>}
</div>
<div ref={ref => this.extraRef = ref} style={{ float: 'right', display: 'inline-block', paddingTop: 6 }}>
{Object.prototype.toString.call(this.state.right) === '[object Function]' ? this.state.right() : this.state.right}
</div>
</div>
{this.props.namespaceCallBack ? <div><NameSpaceList ref={ref => this.nameSpaceList = ref} namespaceCallBack={this.props.namespaceCallBack} setNowNameSpace={this.props.setNowNameSpace} /></div> : null}
</div>
</div>;
}
}
/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/
export default RegionGroup;

View File

@ -0,0 +1,3 @@
import RegionGroup from './RegionGroup';
export default RegionGroup;

View File

@ -0,0 +1,283 @@
import React from 'react';
import './index.less';
import { Dialog, Loading, Tab } from '@alifd/next';
const TabPane = Tab.Item;
/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/
class ShowCodeing extends React.Component {
constructor(props) {
super(props);
this.state = {
dialogvisible: false,
loading: false
};
this.defaultCode = ``;
this.nodejsCode = `TODO`;
this.cppCode = `TODO`;
this.shellCode = `TODO`;
this.pythonCode = `TODO`;
this.record = {};
this.sprigboot_code = `// Refer to document: https://github.com/nacos-group/nacos-examples/tree/master/nacos-spring-boot-example/nacos-spring-boot-config-example
package com.alibaba.nacos.example.spring.boot.controller;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import static org.springframework.web.bind.annotation.RequestMethod.GET;
@Controller
@RequestMapping("config")
public class ConfigController {
@Value("\${useLocalCache:false}")
private boolean useLocalCache;
public void setUseLocalCache(boolean useLocalCache) {
this.useLocalCache = useLocalCache;
}
@RequestMapping(value = "/get", method = GET)
@ResponseBody
public boolean get() {
return useLocalCache;
}
}`;
this.sprigcloud_code = `// Refer to document: https://github.com/nacos-group/nacos-examples/tree/master/nacos-spring-cloud-example/nacos-spring-cloud-config-example
package com.alibaba.nacos.example.spring.cloud.controller;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/config")
@RefreshScope
public class ConfigController {
@Value("\${useLocalCache:false}")
private boolean useLocalCache;
@RequestMapping("/get")
public boolean get() {
return useLocalCache;
}
}`;
}
componentDidMount() {}
openLoading() {
this.setState({
loading: true
});
}
closeLoading() {
this.setState({
loading: false
});
}
getData() {
let namespace = window.getParams('namespace'); //获取ak,sk
let obj = {
group: this.record.group || '',
dataId: this.record.dataId || '',
namespace: namespace,
inEdas: window.globalConfig.isParentEdas()
};
this.defaultCode = this.getJavaCode(obj);
this.createCodeMirror('text/x-java', this.defaultCode);
this.nodejsCode = this.getNodejsCode(obj);
this.cppCode = this.getCppCode(obj);
this.shellCode = this.getShellCode(obj);
this.pythonCode = this.getPythonCode(obj);
this.forceUpdate();
}
getJavaCode(data) {
return `/*
* 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.example;
import java.util.Properties;
import java.util.concurrent.Executor;
import com.alibaba.nacos.api.NacosFactory;
import com.alibaba.nacos.api.config.ConfigService;
import com.alibaba.nacos.api.config.listener.Listener;
import com.alibaba.nacos.api.exception.NacosException;
/**
* Config service example
*
* @author Nacos
*
*/
public class ConfigExample {
public static void main(String[] args) throws NacosException, InterruptedException {
String serverAddr = "localhost";
String dataId = "${data.dataId}";
String group = "${data.group}";
Properties properties = new Properties();
properties.put("serverAddr", serverAddr);
ConfigService configService = NacosFactory.createConfigService(properties);
String content = configService.getConfig(dataId, group, 5000);
System.out.println(content);
configService.addListener(dataId, group, new Listener() {
@Override
public void receiveConfigInfo(String configInfo) {
System.out.println("recieve:" + configInfo);
}
@Override
public Executor getExecutor() {
return null;
}
});
boolean isPublishOk = configService.publishConfig(dataId, group, "content");
System.out.println(isPublishOk);
Thread.sleep(3000);
content = configService.getConfig(dataId, group, 5000);
System.out.println(content);
boolean isRemoveOk = configService.removeConfig(dataId, group);
System.out.println(isRemoveOk);
Thread.sleep(3000);
content = configService.getConfig(dataId, group, 5000);
System.out.println(content);
Thread.sleep(300000);
}
}
`;
}
getNodejsCode(data) {
return `TODO`;
}
getCppCode(data) {
return `TODO`;
}
getShellCode(data) {
return `TODO`;
}
getPythonCode(data) {
return `TODO`;
}
openDialog(record) {
this.setState({
dialogvisible: true
});
this.record = record;
setTimeout(() => {
this.getData(); //获取数据
});
}
closeDialog() {
this.setState({
dialogvisible: false
});
}
createCodeMirror(mode, value) {
let commontarget = this.refs['codepreview'];
if (commontarget) {
commontarget.innerHTML = '';
this.cm = window.CodeMirror(commontarget, {
value: value,
mode: mode,
height: 400,
width: 500,
lineNumbers: true,
theme: 'xq-light',
lint: true,
tabMode: "indent",
autoMatchParens: true,
textWrapping: true,
gutters: ["CodeMirror-lint-markers"],
extraKeys: {
"F1": function (cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
},
"Esc": function (cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
}
}
});
}
//this.cm.setSize(window.innerWidth*0.8-10,400);//设置宽高
}
changeTab(key, code) {
setTimeout(() => {
this[key] = true;
this.createCodeMirror('text/javascript', code);
});
}
render() {
const footer = <div></div>;
return (
<div>
<Dialog title={window.aliwareIntl.get('com.alibaba.nacos.component.ShowCodeing.Sample_code')} style={{ width: '80%' }} visible={this.state.dialogvisible} footer={footer} onClose={this.closeDialog.bind(this)} language={window.aliwareIntl.currentLanguageCode}>
<div style={{ height: 500 }}>
<Loading tip={window.aliwareIntl.get('com.alibaba.nacos.component.ShowCodeing.loading')} style={{ width: '100%' }} visible={this.state.loading}>
<Tab shape={'text'} style={{ height: 40, paddingBottom: 10 }}>
<TabPane title={'Java'} key={1} onClick={this.changeTab.bind(this, 'commoneditor1', this.defaultCode)}>
</TabPane>
<TabPane title={'Spring Boot'} key={2} onClick={this.changeTab.bind(this, 'commoneditor2', this.sprigboot_code)}>
</TabPane>
<TabPane title={'Spring Cloud'} key={21} onClick={this.changeTab.bind(this, 'commoneditor21', this.sprigcloud_code)}>
</TabPane>
<TabPane title={'Node.js'} key={3} onClick={this.changeTab.bind(this, 'commoneditor3', this.nodejsCode)}>
</TabPane>
<TabPane title={'C++'} key={4} onClick={this.changeTab.bind(this, 'commoneditor4', this.cppCode)}>
</TabPane>
<TabPane title={'Shell'} key={5} onClick={this.changeTab.bind(this, 'commoneditor5', this.shellCode)}>
</TabPane>
<TabPane title={'Python'} key={6} onClick={this.changeTab.bind(this, 'commoneditor6', this.pythonCode)}>
</TabPane>
{}
</Tab>
<div ref={'codepreview'}></div>
</Loading>
</div>
</Dialog>
</div>
);
}
}
/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/
export default ShowCodeing;

View File

@ -0,0 +1,3 @@
import ShowCodeing from './ShowCodeing';
export default ShowCodeing;

View File

@ -0,0 +1,80 @@
import React from 'react';
import './index.less';
import { Button, Dialog, Grid, Icon } from '@alifd/next';
const { Row, Col } = Grid;
/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/
class SuccessDialog extends React.Component {
constructor(props) {
super(props);
this.state = {
visible: false,
title: window.aliwareIntl.get('com.alibaba.nacos.component.SuccessDialog.Configuration_management'),
maintitle: '',
content: '',
isok: true,
dataId: '',
group: ''
};
}
componentDidMount() {}
openDialog(payload) {
if(this.props.unpushtrace) {
payload.title = '';
}
this.setState({
visible: true,
maintitle: payload.maintitle,
title: payload.title,
content: payload.content,
isok: payload.isok,
dataId: payload.dataId,
group: payload.group,
message: payload.message
});
}
closeDialog() {
this.setState({
visible: false
});
}
render() {
const footer = <div style={{ textAlign: 'right' }}><Button type="primary" onClick={this.closeDialog.bind(this)}>{window.aliwareIntl.get('com.alibaba.nacos.component.SuccessDialog.determine')}</Button></div>;
return <div>
<Dialog visible={this.state.visible} footer={footer} style={{ width: 555 }} onCancel={this.closeDialog.bind(this)} onClose={this.closeDialog.bind(this)} title={this.state.maintitle || this.state.title} language={window.aliwareIntl.currentLanguageCode}>
<div>
<Row>
<Col span={'4'} style={{ paddingTop: 16 }}>
{this.state.isok ? <Icon type="success-filling" style={{ color: 'green' }} size={'xl'} /> : <Icon type="delete-filling" style={{ color: 'red' }} size={'xl'} />}
</Col>
<Col span={'20'}>
<div>
{this.state.isok ? <h3>{this.state.title}</h3> : <h3>{this.state.title} {window.aliwareIntl.get('com.alibaba.nacos.component.SuccessDialog.failure')}</h3>}
<p>
<span style={{ color: '#999', marginRight: 5 }}>Data ID:</span>
<span style={{ color: '#c7254e' }}>
{this.state.dataId}
</span>
</p>
<p>
<span style={{ color: '#999', marginRight: 5 }}>Group:</span>
<span style={{ color: '#c7254e' }}>
{this.state.group}
</span>
</p>
{this.state.isok ? '' : <p style={{ color: 'red' }}>{this.state.message}</p>}
</div>
</Col>
</Row>
</div>
</Dialog>
</div>;
}
}
/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/
export default SuccessDialog;

View File

@ -0,0 +1,3 @@
import SuccessDialog from './SuccessDialog';
export default SuccessDialog;

View File

@ -0,0 +1,200 @@
import React from 'react';
import { Button, Dialog, Input } from '@alifd/next';
import $ from 'jquery';
import './index.less';
/*****************************此行为标记行, 请勿删和修改此行, 文件和组件依赖请写在此行上面, 主体代码请写在此行下面的class中*****************************/
class ValidateDialog extends React.Component {
constructor(props) {
super(props);
this.state = {
dialCode: '86',
phoneNumber: '',
isValid: false,
errorInfoCode: 0,
visible: false,
btnText: window.aliwareIntl.get("nacos.component.validateDialog.Click_to_get_verification_code"),
defaultBtnText: window.aliwareIntl.get("nacos.component.validateDialog.Click_to_get_verification_code"),
disabled: false,
submitDisabled: false,
verifyCode: '',
codeType: '',
verifyDetail: '',
config: {},
requestId: ''
};
this.telRef = null;
this.disabled = false;
this.submitDisabled = false;
this.timer = null;
this.countTime = 60;
this.eventName = "validate";
}
componentDidMount() {
window.narutoEvent && window.narutoEvent.listen(this.eventName, _obj => {
console.log("_OBJ: ", _obj);
this.setState({
codeType: _obj.codeType,
verifyDetail: _obj.verifyDetail,
visible: true,
config: _obj.config || {}
});
});
// let country = this.getCountryNameByDialCode(this.state.dialCode);
// if (this.telRef) {
// $(this.telRef).intlTelInput({
// initialCountry: country,
// preferredCountries: ['cn'],
// // formatOnDisplay: false
// // utilsScript: "http://midwayfe.oss-cn-shanghai.aliyuncs.com/egg-multipart-test/intlTellInputUtils.js"
// })
// // $(this.telRef).intlTelInput("handleUtils");
// $(this.telRef).intlTelInput("setNumber", `${this.state.phoneNumber}`);
// $(this.telRef).on("countrychange", (e, dialCode) => {
// console.log("countrychange: ", dialCode)
// this.setState({
// dialCode
// });
// setTimeout(() => {
// this.onChangePhoneNumber()
// })
// })
// }
}
componentWillUnmount() {
if (this.telRef) {
$(this.telRef).unbind("countrychange");
$(this.telRef).intlTelInput("destroy");
}
window.narutoEvent && window.narutoEvent.remove(this.eventName);
clearInterval(this.timer);
}
getCountryNameByDialCode(dialCode) {
let countryName = 'cn';
let countryData = $.fn.intlTelInput.getCountryData();
countryData.some(obj => {
if (obj.dialCode === dialCode) {
countryName = obj.iso2;
return true;
}
return false;
});
return countryName;
}
onChangePhoneNumber() {
let dataObj = this.getTelInputInfo();
console.log(dataObj);
this.props.changeValue && this.props.changeValue(dataObj);
}
onClose() {
this.setState({
visible: false
});
}
onClickBtn() {
this.disabled = true;
this.setState({
disabled: true
});
window.request({
url: 'com.alibaba.nacos.service.sendVerifyCode', //以 com.alibaba. 开头最终会转换为真正的url地址
data: {
codeType: this.state.codeType
},
$data: {}, //替换{}中的内容
success: res => {
if (res && res.code === 200) {
this.setState({
requestId: res.data && res.data.window.requestId || ''
});
let count = this.countTime;
clearInterval(this.timer);
this.timer = setInterval(() => {
if (count === -1) {
this.initBtn();
return;
}
this.setState({
btnText: count
});
count--;
}, 1000);
}
}
});
}
initBtn() {
clearInterval(this.timer);
this.disabled = false;
this.setState({
disabled: false,
btnText: this.state.defaultBtnText
});
}
onValidateVerifyCode() {
if (!this.state.verifyCode) {
Dialog.alert({
content: window.aliwareIntl.get("nacos.component.validateDialog.fill_the_code"),
language: window.aliwareIntl.currentLanguageCode
});
return;
}
let config = this.state.config;
let data = Object.assign({}, config.data, {
codeType: this.state.codeType,
verifyCode: this.state.verifyCode,
requestId: this.state.requestId
});
let preSucess = config.success;
this.setState({
submitDisabled: true
});
this.submitDisabled = true;
window.request(Object.assign({}, config, {
data: data,
success: res => {
this.setState({
submitDisabled: false
});
this.submitDisabled = false;
if (res && res.code === 200) {
// window.location.reload && window.location.reload();
this.onClose();
this.initBtn();
typeof preSucess === "function" && preSucess(res);
} else {
Dialog.alert({
content: res.code === 400 ? window.aliwareIntl.get("nacos.component.validateDialog.verification_code_error") : res.message,
language: window.aliwareIntl.currentLanguageCode
});
}
}
}));
}
onChangeVerifyCode(verifyCode) {
this.setState({
verifyCode
});
}
render() {
let footer = <div><Button type="primary" onClick={this.onValidateVerifyCode.bind(this)} disabled={this.submitDisabled}>{window.aliwareIntl.get("nacos.component.validateDialog.confirm")}</Button><Button type="normal" onClick={this.onClose.bind(this)}>{window.aliwareIntl.get("nacos.component.validateDialog.cancel")}</Button></div>;
return <Dialog title={window.aliwareIntl.get("nacos.component.validateDialog.title")} style={{ color: '#73777A', width: 550 }} visible={this.state.visible} onOk={this.onValidateVerifyCode.bind(this)} onCancel={this.onClose.bind(this)} onClose={this.onClose.bind(this)} footer={footer} language={window.aliwareIntl.currentLanguageCode}>
<div>
<div style={{ marginBottom: 20 }}>
<span style={{ display: 'inline-block', verticalAlign: 'middle', width: 100, textAlign: 'right', marginRight: 10 }}>{window.aliwareIntl.get("nacos.component.validateDialog.phoneNumber")}</span><span>{this.state.verifyDetail}</span>
</div>
<div>
<span style={{ display: 'inline-block', verticalAlign: 'middle', width: 100, textAlign: 'right' }}>{window.aliwareIntl.get("nacos.component.validateDialog.Please_fill_out_the_verification_code")} </span>
<Input style={{ margin: '0 10px', height: 32, width: 200, verticalAlign: 'top' }} onChange={this.onChangeVerifyCode.bind(this)} />
<Button onClick={this.onClickBtn.bind(this)} disabled={this.disabled} style={{ minWidth: 150 }}>{this.state.btnText}</Button>
<p style={{ margin: "12px", color: "#999" }}>{window.aliwareIntl.get("nacos.component.validateDialog.remark")}</p>
</div>
</div>
</Dialog>;
}
}
/*****************************此行为标记行, 请勿删和修改此行, 主体代码请写在此行上面的class中, 组件导出语句及其他信息请写在此行下面*****************************/
export default ValidateDialog;

Some files were not shown because too many files have changed in this diff Show More