Skip to content

Commit

Permalink
Merge pull request #4 from alibaba/develop
Browse files Browse the repository at this point in the history
merge latest code
  • Loading branch information
paderlol authored Jan 26, 2019
2 parents 25e4b86 + 2c97c10 commit b67c6e1
Show file tree
Hide file tree
Showing 54 changed files with 395 additions and 140 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.js linguist-language=java
*.css linguist-language=java
*.html linguist-language=java
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@
## 0.8.0(Jan 22, 2019) PRE-GA

* [#162] Support open metrics and prometheus
* [#268] Health check is performed in the Nacos startup script
* [#320] Nacos supports multiple configuration files, configuration template abstraction and inheritance
* [#333] Use nacos in k8s to get hostname exception
* [#335] update nacos.io docker img priority/low
* [#339] Project language problem identified in github
* [#381] Discuss:How to support Login
* [#397] Some questions for Nacos
* [#402] When the configuration is added or edited, the edit box will not come out
* [#462] Nacos monitor discuss (0.8 version)
* [#496] Warning log printing when quering a nonexistent service
* [#497] Make subscription of service triggered by getInstance method optional
* [#498] Support namespace for service discovery
* [#499] When the configuration is newly created (if data-id and group already exist), the original configuration will be overwritten
* [#512] nacos-logs start.out always print 8848 (but port can be changed)
* [#514] Nacos 0.7 not support namespace
* [#523] Add a switch to control server detection and client reporting heartbeat switching
* [#526] Possible data loss in server side health check mode
* [#527] Many repeat client beat tasks can be generated
* [#558] Enable access log recording by default
* [#560] Nacos server startup issues
* [#579] New API support - “update health in none health check mode through api”
* [#587] Client sends request concurrently
* [#592] Service restful interface put/post is reversed
* [#599] getSubscribeServices method gets services that were deregistered
* [#603] Format log of naming module
* [#609] Always print a NPE log at start
* [#663] Nacos update instance info NPE
* [#668] 0.8.0-SNAPSHOT naming heartbeat not compatible with lower version client
* [#672] Startup.cmd bug

## 0.7.0(Dec, 2018)

* [ #461 ] Registration failed when instance port is set to 0
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ It is super easy to get started with your first project.

You can download the package from the [latest stable release](https://github.com/alibaba/nacos/releases).

Take release nacos-server-0.7.0.zip for example.
Take release nacos-server-0.8.0.zip for example.
```
unzip nacos-server-0.7.0.zip
unzip nacos-server-0.8.0.zip
cd nacos/bin
```

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.8.0-SNAPSHOT</version>
<version>0.8.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.8.0-SNAPSHOT</version>
<version>0.8.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ static public HttpResult httpGet(String url, List<String> headers, List<String>
static public HttpResult httpPost(String url, List<String> headers, List<String> paramValues,
String encoding, long readTimeoutMs, boolean isSSL) throws IOException {
String encodedContent = encodingParams(paramValues, encoding);
encodedContent = (null == encodedContent) ? "" : encodedContent;
if (Limiter.isLimit(MD5.getInstance().getMD5String(
new StringBuilder(url).append(encodedContent).toString()))) {
return new HttpResult(NacosException.CLIENT_OVER_THRESHOLD,
Expand Down
2 changes: 1 addition & 1 deletion cmdb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<artifactId>nacos-all</artifactId>
<groupId>com.alibaba.nacos</groupId>
<version>0.8.0-SNAPSHOT</version>
<version>0.8.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
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.8.0-SNAPSHOT</version>
<version>0.8.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class HttpMethod {

public static final String DELETE = "DELETE";

public static final String OPTIONS = "PATCH";
public static final String OPTIONS = "OPTIONS";

public static final String TRACE = "TRACE";
}
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.8.0-SNAPSHOT</version>
<version>0.8.0</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
4 changes: 2 additions & 2 deletions config/src/main/resources/META-INF/nacos-db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,6 @@ CREATE TABLE roles (
role varchar(50) NOT NULL
);

INSERT INTO users (username, password, enabled) VALUES ('admin', '$2a$10$HxtJtd59imujvbux.i55zOGewhnJiLVXX8D9AETDMV.XtBLDGOXtW', TRUE);
INSERT INTO users (username, password, enabled) VALUES ('nacos', '$2a$10$EuWPZHzz32dJN7jexM34MOeYirDdFAZm2kuWj7VEOJhhZkDrxfvUu', TRUE);

INSERT INTO roles (username, role) VALUES ('admin', 'ROLE_ADMIN');
INSERT INTO roles (username, role) VALUES ('nacos', 'ROLE_ADMIN');
4 changes: 2 additions & 2 deletions config/src/main/resources/META-INF/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,6 @@ CREATE TABLE roles (
role varchar(50) NOT NULL
);

INSERT INTO users (username, password, enabled) VALUES ('admin', '$2a$10$HxtJtd59imujvbux.i55zOGewhnJiLVXX8D9AETDMV.XtBLDGOXtW', TRUE);
INSERT INTO users (username, password, enabled) VALUES ('nacos', '$2a$10$EuWPZHzz32dJN7jexM34MOeYirDdFAZm2kuWj7VEOJhhZkDrxfvUu', TRUE);

INSERT INTO roles (username, role) VALUES ('admin', 'ROLE_ADMIN');
INSERT INTO roles (username, role) VALUES ('nacos', 'ROLE_ADMIN');
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.8.0-SNAPSHOT</version>
<version>0.8.0</version>
</parent>
<artifactId>nacos-console</artifactId>
<!--<packaging>war</packaging>-->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* 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.console.utils;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

/**
* Password encoder tool
*
* @author nacos
*/
public class PasswordEncoderUtil {

public static void main(String[] args) {
System.out.println(new BCryptPasswordEncoder().encode("nacos"));
}
}
4 changes: 2 additions & 2 deletions console/src/main/resources/META-INF/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,6 @@ CREATE TABLE roles (
role varchar(50) NOT NULL
);

INSERT INTO users (username, password, enabled) VALUES ('admin', '$2a$10$HxtJtd59imujvbux.i55zOGewhnJiLVXX8D9AETDMV.XtBLDGOXtW', TRUE);
INSERT INTO users (username, password, enabled) VALUES ('nacos', '$2a$10$EuWPZHzz32dJN7jexM34MOeYirDdFAZm2kuWj7VEOJhhZkDrxfvUu', TRUE);

INSERT INTO roles (username, role) VALUES ('admin', 'ROLE_ADMIN');
INSERT INTO roles (username, role) VALUES ('nacos', 'ROLE_ADMIN');
3 changes: 2 additions & 1 deletion console/src/main/resources/static/console-fe/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"no-template-curly-in-string": "off",
"no-unused-vars": "off",
"no-tabs": "off",
"no-param-reassign": "off",
"react/no-string-refs": "off",
"react/no-unused-state": "off",
"no-return-assign": "off",
Expand All @@ -29,6 +30,6 @@
"generator-star-spacing": "off",
"wrap-iife": "off",
"arrow-parens": "off",
"indent": "off",
"indent": "off"
}
}
2 changes: 1 addition & 1 deletion console/src/main/resources/static/console-fe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"webpack-dev-server": "^3.1.13"
},
"dependencies": {
"@alifd/next": "^1.11.5",
"@alifd/next": "^1.11.10",
"axios": "^0.18.0",
"jquery": "^3.3.1",
"moment": "^2.23.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ select,
textarea {
font-family: inherit;
font-size: inherit;
line-height: inherit;
}

a {
Expand Down Expand Up @@ -7122,4 +7121,4 @@ td.visible-print {
td.hidden-print {
display: none !important;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<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" type="text/css" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/console1412.css">
<!-- 第三方css开始 -->
<link rel="stylesheet" type="text/css" href="css/codemirror.css">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ class EditorNameSpace extends React.Component {
<Input
{...this.field.init('namespaceDesc', {
rules: [
{ required: true, message: locale.namespace },
{ required: true, message: locale.namespaceDesc },
{ validator: this.validateChart.bind(this) },
],
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class NewNameSpace extends React.Component {
rules: [
{
required: true,
message: locale.namespacenotnull,
message: locale.namespacedescnotnull,
},
{ validator: this.validateChart.bind(this) },
],
Expand Down
1 change: 0 additions & 1 deletion console/src/main/resources/static/console-fe/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ class App extends React.Component {
<HashRouter>
<Switch>
<Route path="/login" component={Login} />

<Layout navList={_menu.data}>
{MENU.map(item => (
<Route key={item.path} {...item} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class Header extends React.Component {

static propTypes = {
locale: PropTypes.object,
history: PropTypes.object,
location: PropTypes.object,
language: PropTypes.string,
changeLanguage: PropTypes.func,
};
Expand All @@ -53,7 +55,6 @@ class Header extends React.Component {
const base64Url = token.split('.')[1];
const base64 = base64Url.replace('-', '+').replace('_', '/');
const parsedToken = JSON.parse(window.atob(base64));
console.log(parsedToken);
return parsedToken.sub;
}
return '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import $ from 'jquery';
import { setParams } from '../globalLib';
import { connect } from 'react-redux';

import './index.scss';

@withRouter
@connect(state => ({ ...state.locale }))
@ConfigProvider.config
Expand All @@ -29,6 +31,7 @@ class MainLayout extends React.Component {
static propTypes = {
navList: PropTypes.array,
history: PropTypes.object,
location: PropTypes.object,
locale: PropTypes.object,
children: PropTypes.any,
};
Expand Down Expand Up @@ -72,6 +75,11 @@ class MainLayout extends React.Component {
iconClass.className = tmpClassName;
}

/**
* Click the back button
* TODO: this.props.history.goBack(); ???
* @param url
*/
nacosGoBack(url) {
const params = window.location.hash.split('?')[1];
const urlArr = params.split('&') || [];
Expand All @@ -91,6 +99,9 @@ class MainLayout extends React.Component {
}
}
}
if (localStorage.getItem('namespace')) {
queryParams.push(`namespace=${localStorage.getItem('namespace')}`);
}
this.props.history.push(`/${url}?${queryParams.join('&')}`);
}

Expand Down Expand Up @@ -201,7 +212,8 @@ class MainLayout extends React.Component {
}

nacosLoopNav(data, _index = 0, parent) {
const { locale = {} } = this.props;
const { locale = {}, location = {} } = this.props;
const { pathname } = location;
let index = _index;
// 遍历导航,只显示2级
const self = this;
Expand Down Expand Up @@ -238,6 +250,7 @@ class MainLayout extends React.Component {
} else {
return (
<li
className={pathname === `/${item.serviceName}` ? 'selected' : ''}
key={`${item.serviceName}`}
data-spm-click={`gostr=/aliyun;locaid=${item.serviceName}`}
onClick={this.navTo.bind(this, `/${item.serviceName}`)}
Expand All @@ -256,6 +269,7 @@ class MainLayout extends React.Component {
}
return (
<li
className={pathname === `/${item.serviceName}` ? 'selected' : ''}
key={`${item.serviceName}`}
data-spm-click={`gostr=/aliyun;locaid=${item.serviceName}`}
onClick={this.navTo.bind(this, `/${item.serviceName}`)}
Expand Down Expand Up @@ -396,7 +410,6 @@ class MainLayout extends React.Component {
<span style={{ marginLeft: 5 }}>{nacosVersion}</span>
</div>
)}

<div
className="product-nav-list"
style={{ position: 'relative', top: 0, height: '100%' }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1394,3 +1394,7 @@ h6 {
padding-right: 20px;
}
}

.product-nav-list li.selected a {
background-color: #F4F6F8;
}
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ const I18N_CONF = {
healthCheckPatternService: 'Service',
healthCheckPatternClient: 'Client',
healthCheckPatternNone: 'None',
serviceNameRequired: 'Please enter a service name',
protectThresholdRequired: 'Please enter a protect threshold',
healthCheckModeRequired: 'Please select health check pattern',
},
InstanceTable: {
operation: 'Operation',
Expand Down Expand Up @@ -312,6 +315,7 @@ const I18N_CONF = {
editNamespace: 'Loading...',
load: 'Namespace:',
namespace: 'Namespace cannot be empty',
namespaceDesc: 'Namespace description cannot be empty',
description: 'Description:',
},
ExportDialog: {
Expand Down Expand Up @@ -366,6 +370,7 @@ const I18N_CONF = {
loading: 'Loading...',
name: 'Namespace:',
namespacenotnull: 'Namespace cannot be empty',
namespacedescnotnull: 'Namespace description cannot be empty',
description: 'Description:',
},
NameSpaceList: {
Expand Down
Loading

0 comments on commit b67c6e1

Please sign in to comment.