Skip to content

Commit

Permalink
Merge pull request alibaba#221 from alibaba/develop
Browse files Browse the repository at this point in the history
Release 0.4.0
  • Loading branch information
yanlinly authored Nov 5, 2018
2 parents 01a25ea + 9369f18 commit f1d0ec4
Show file tree
Hide file tree
Showing 27 changed files with 99 additions and 73 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,13 @@ For more details, see [quick-start.](https://nacos.io/en-us/docs/quick-start.htm
## Quick start for other open-source projects:
* [Quick start with Nacos command and console](https://nacos.io/en-us/docs/quick-start.html)

* [Quick start with spring cloud](https://nacos.io/en-us/docs/use-nacos-with-springcloud.html)

* [Quick start with dubbo](https://nacos.io/en-us/docs/use-nacos-with-dubbo.html)

* [quick start with spring cloud](https://nacos.io/en-us/docs/quick-start-spring-cloud.html)

* [Quick start with kubernetes](https://nacos.io/en-us/docs/use-nacos-with-kubernetes.html)


## Documentation

You can view the full documentation from the [Nacos website](https://nacos.io/en-us/docs/what-is-nacos.html).
Expand All @@ -79,9 +80,7 @@ You can view the full documentation from the [Nacos website](https://nacos.io/en
* [nacos-sync](https://github.com/nacos-group/nacos-sync) is a tool to synchronize the service registration information from other tools like eureka, zookeeper, etc, to Nacos.
* [spring-cloud-alibaba](https://github.com/spring-cloud-incubator/spring-cloud-alibaba) provides the one-stop solution for application development over Alibaba middleware which includes Nacos.



## Contact
### Contact

* #### Gitter-[Nacos Gitter](https://gitter.im/alibaba/nacos)

Expand Down
2 changes: 1 addition & 1 deletion api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>0.3.0</version>
<version>0.4.0</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>0.3.0</version>
<version>0.4.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>0.3.0</version>
<version>0.4.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>0.3.0</version>
<version>0.4.0</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import javax.servlet.http.HttpServletResponse;

/**
* capcity manage
* Capacity Management
*
* @author hexu.hxy
*/
Expand All @@ -42,8 +42,10 @@ public class CapacityController {

private static final Logger LOGGER = LoggerFactory.getLogger(CapacityController.class);

private final CapacityService capacityService;

@Autowired
private CapacityService capacityService;
public CapacityController(CapacityService capacityService) {this.capacityService = capacityService;}

@ResponseBody
@RequestMapping(method = RequestMethod.GET)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;


/**
Expand All @@ -45,15 +43,19 @@
@RequestMapping(Constants.COMMUNICATION_CONTROLLER_PATH)
public class CommunicationController {

@Autowired
private DumpService dumpService;
private final DumpService dumpService;

@Autowired
protected LongPollingService longPollingService;
private final LongPollingService longPollingService;

private String trueStr = "true";

/**

@Autowired
public CommunicationController(DumpService dumpService, LongPollingService longPollingService) {
this.dumpService = dumpService;
this.longPollingService = longPollingService;
}

/**
* 通知配置信息改变
*
*/
Expand Down Expand Up @@ -87,11 +89,9 @@ public SampleResult getSubClientConfig(HttpServletRequest request,
@RequestParam("dataId") String dataId,
@RequestParam("group") String group,
@RequestParam(value = "tenant", required = false) String tenant,
ModelMap modelMap)
throws IOException, ServletException, Exception {
ModelMap modelMap) {
group = StringUtils.isBlank(group) ? Constants.DEFAULT_GROUP : group;
SampleResult sampleResult = longPollingService.getCollectSubscribleInfo(dataId, group, tenant);
return sampleResult;
return longPollingService.getCollectSubscribleInfo(dataId, group, tenant);
}

/**
Expand All @@ -100,11 +100,7 @@ public SampleResult getSubClientConfig(HttpServletRequest request,
@RequestMapping(value= "/watcherConfigs", method = RequestMethod.GET)
@ResponseBody
public SampleResult getSubClientConfigByIp(HttpServletRequest request,
HttpServletResponse response,
@RequestParam("ip") String ip,
ModelMap modelMap)
throws IOException, ServletException, Exception {
SampleResult sampleResult = longPollingService.getCollectSubscribleInfoByIp(ip);
return sampleResult;
HttpServletResponse response, @RequestParam("ip") String ip,ModelMap modelMap) {
return longPollingService.getCollectSubscribleInfoByIp(ip);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import com.alibaba.nacos.config.server.service.ConfigDataChangeEvent;
import com.alibaba.nacos.config.server.service.ConfigSubService;
import com.alibaba.nacos.config.server.service.PersistService;
import com.alibaba.nacos.config.server.service.merge.MergeDatumService;
import com.alibaba.nacos.config.server.service.trace.ConfigTraceService;
import com.alibaba.nacos.config.server.utils.*;
import com.alibaba.nacos.config.server.utils.event.EventDispatcher;
Expand Down Expand Up @@ -61,17 +60,13 @@ public class ConfigController {
private final transient ConfigServletInner inner;

private final transient PersistService persistService;

private final transient MergeDatumService mergeService;

private final transient ConfigSubService configSubService;

@Autowired
public ConfigController(ConfigServletInner configServletInner, PersistService persistService, MergeDatumService mergeService,
ConfigSubService configSubService) {
public ConfigController(ConfigServletInner configServletInner, PersistService persistService, ConfigSubService configSubService) {
this.inner = configServletInner;
this.persistService = persistService;
this.mergeService = mergeService;
this.configSubService = configSubService;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,7 @@ private static int tryConfigReadLock(HttpServletRequest request, HttpServletResp

private static boolean isUseTag(CacheItem cacheItem, String tag) {
if (cacheItem != null && cacheItem.tagMd5 != null && cacheItem.tagMd5.size() > 0) {
if (StringUtils.isNotBlank(tag) && cacheItem.tagMd5.containsKey(tag)) {
return true;
}
return StringUtils.isNotBlank(tag) && cacheItem.tagMd5.containsKey(tag);
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@
@RequestMapping(Constants.HEALTH_CONTROLLER_PATH)
public class HealthController {

@Autowired
private DynamicDataSource dynamicDataSource;
private final DynamicDataSource dynamicDataSource;
private DataSourceService dataSourceService;
private String heathUpStr = "UP";
private String heathDownStr = "DOWN";
private String heathWarnStr = "WARN";

@Autowired
public HealthController(DynamicDataSource dynamicDataSource) {this.dynamicDataSource = dynamicDataSource;}

@PostConstruct
public void init() {
dataSourceService = dynamicDataSource.getDataSource();
Expand All @@ -63,7 +65,7 @@ public String getHealth() {
sb.append("从数据库 ").append(dbStatus.split(":")[1]).append(" down. ");
} else {
sb.append("DOWN:");
if (dbStatus.indexOf(heathDownStr) != -1) {
if (dbStatus.contains(heathDownStr)) {
sb.append("主数据库 ").append(dbStatus.split(":")[1]).append(" down. ");
}
if (!ServerListService.isAddressServerHealth()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ public Page<ConfigHistoryInfo> listConfigHistory(HttpServletRequest request, Htt
pageSize = null == pageSize ? Integer.valueOf(100) : pageSize;
pageSize = pageSize > 500 ? Integer.valueOf(500) : pageSize;
// configInfoBase没有appName字段
Page<ConfigHistoryInfo> page = persistService.findConfigHistory(dataId, group, tenant, pageNo, pageSize);
return page;
return persistService.findConfigHistory(dataId, group, tenant, pageNo, pageSize);
}

/**
Expand All @@ -68,8 +67,7 @@ public Page<ConfigHistoryInfo> listConfigHistory(HttpServletRequest request, Htt
@ResponseBody
public ConfigHistoryInfo getConfigHistoryInfo(HttpServletRequest request, HttpServletResponse response,
@RequestParam("nid") Long nid, ModelMap modelMap) {
ConfigHistoryInfo configInfo = persistService.detailConfigHistory(nid);
return configInfo;
return persistService.detailConfigHistory(nid);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

Expand All @@ -46,9 +44,11 @@
@RequestMapping(Constants.LISTENER_CONTROLLER_PATH)
public class ListenerController {

private final ConfigSubService configSubService;

@Autowired
ConfigSubService configSubService;
public ListenerController(ConfigSubService configSubService) {this.configSubService = configSubService;}

/*
* 获取客户端订阅配置信息
*/
Expand All @@ -57,8 +57,7 @@ public class ListenerController {
public GroupkeyListenserStatus getAllSubClientConfigByIp(HttpServletRequest request, HttpServletResponse response,
@RequestParam("ip") String ip, @RequestParam(value = "all", required = false) boolean all,
@RequestParam(value = "tenant", required = false) String tenant,
@RequestParam(value = "sampleTime", required = false, defaultValue = "1") int sampleTime, ModelMap modelMap)
throws IOException, ServletException, Exception {
@RequestParam(value = "sampleTime", required = false, defaultValue = "1") int sampleTime, ModelMap modelMap) throws Exception {
SampleResult collectSampleResult = configSubService.getCollectSampleResultByIp(ip, sampleTime);
GroupkeyListenserStatus gls = new GroupkeyListenserStatus();
gls.setCollectStatus(200);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,15 @@ public class OpsController {

private static final Logger log = LoggerFactory.getLogger(OpsController.class);

@Autowired
protected PersistService persistService;
protected final PersistService persistService;

private final DumpService dumpService;

@Autowired
DumpService dumpService;
public OpsController(PersistService persistService, DumpService dumpService) {
this.persistService = persistService;
this.dumpService = dumpService;
}

// ops call
@RequestMapping(value = "/localCache", method = RequestMethod.POST)
Expand Down
2 changes: 1 addition & 1 deletion console/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>0.3.0</version>
<version>0.4.0</version>
</parent>
<artifactId>nacos-console</artifactId>
<!--<packaging>war</packaging>-->
Expand Down
3 changes: 0 additions & 3 deletions console/src/main/resources/static/build.sh

This file was deleted.

2 changes: 1 addition & 1 deletion console/src/main/resources/static/index.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion console/src/main/resources/static/index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions console/src/main/resources/static/src/i18ndoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
module.exports = {
"zh-cn": {
"com.alibaba.nacos.layout.noenv.nacosversion": "0.3.0",
"com.alibaba.nacos.layout.noenv.nacosversion": "0.4.0",
"com.alibaba.nacos.page.configurationManagementVirtual": "配置管理",
"com.alibaba.nacos.page.serviceManagementVirtual": "服务管理",
"nacos.component.ExportDialog.tags2": "标签:",
Expand Down Expand Up @@ -529,7 +529,7 @@ module.exports = {
"nacos.page.ConfigEditor.submit_failed": "不能为空, 提交失败",
},
"en-us": {
"com.alibaba.nacos.layout.noenv.nacosversion": "1.0",
"com.alibaba.nacos.layout.noenv.nacosversion": "0.4.0",
"com.alibaba.nacos.page.configurationManagementVirtual": "ConfigManagement",
"com.alibaba.nacos.page.serviceManagementVirtual": "ServiceManagement",
"nacos.component.CloneDialog.the_same_configuration": "Conflict:",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ class ListeningToQuery extends React.Component {
if (type === 1) {
var ip = this.getValue('ip');
queryUrl = `/nacos/v1/cs/listener?ip=${ip}`;
let tenant = window.nownamespace || getParams('namespace') || '';
if (tenant) {
queryUrl += '&tenant=' + tenant;
}
} else {
var dataId = this.getValue('dataId');
var group = this.getValue('group');
Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>0.3.0</version>
<version>0.4.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
8 changes: 4 additions & 4 deletions core/src/main/resources/banner.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

,--.
,--.'|
,--,: : |
,`--.'`| ' : ,---.
| : : | | ' ,'\ .--.--.
,--,: : | Version: 0.4.0
,`--.'`| ' : ,---. Port: 8848
| : : | | ' ,'\ .--.--. Console: http://localhost:8848/nacos/index.html
: | \ | : ,--.--. ,---. / / | / / '
| : ' '; | / \ / \. ; ,. :| : /`./
' ' ;. ;.--. .-. | / / '' | |: :| : ;_
' ' ;. ;.--. .-. | / / '' | |: :| : ;_ https://nacos.io
| | | \ | \__\/: . .. ' / ' | .; : \ \ `.
' : | ; .' ," .--.; |' ; :__| : | `----. \
| | '`--' / / ,. |' | '.'|\ \ / / /`--' /
Expand Down
Loading

0 comments on commit f1d0ec4

Please sign in to comment.