Skip to content

Commit

Permalink
Merge pull request #683 from alibaba/develop
Browse files Browse the repository at this point in the history
Release 0.8
  • Loading branch information
yanlinly authored Jan 22, 2019
2 parents 489efb3 + f29209b commit ffb8720
Show file tree
Hide file tree
Showing 53 changed files with 308 additions and 142 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
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
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ public class NacosException extends Exception {
public NacosException() {
}

;

public NacosException(int errCode, String errMsg) {
this.errCode = errCode;
this.errMsg = errMsg;
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
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
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ public class ConfigKey implements Serializable {
public ConfigKey() {
}

;

public ConfigKey(String appName, String dataId, String group) {
this.appName = appName;
this.dataId = dataId;
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
Expand Up @@ -47,7 +47,7 @@ public JwtAuthenticationTokenFilter(JwtTokenUtils tokenProvider) {
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException {
String jwt = resolveToken(request);

if (!StringUtils.isEmpty(jwt.trim()) && SecurityContextHolder.getContext().getAuthentication() == null) {
if (jwt != null && !"".equals(jwt.trim()) && SecurityContextHolder.getContext().getAuthentication() == null) {
if (this.tokenProvider.validateToken(jwt)) {
/**
* get auth info
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: 3 additions & 1 deletion console/src/main/resources/META-INF/nacos-default.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ nacos.cmdb.eventTaskInterval=10
nacos.cmdb.labelTaskInterval=300
nacos.cmdb.loadDataAtStart=false

#management.endpoints.web.exposure.include=*

db.num=2
db.url.0=jdbc:mysql://11.162.196.161:3306/diamond_devtest?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true
db.url.1=jdbc:mysql://11.163.152.91:3306/diamond_devtest?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true
Expand All @@ -45,4 +47,4 @@ db.password=4b9622f3f70c7677835ac5a6719e7caf
#management.security=false
#security.basic.enabled=false
#nacos.security.ignore.urls=/**
nacos.security.ignore.urls=/,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/v1/auth/login,/v1/console/health,/v1/cs/**,/v1/ns/**,/v1/cmdb/**
nacos.security.ignore.urls=/,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/v1/auth/login,/v1/console/health,/v1/cs/**,/v1/ns/**,/v1/cmdb/**,/actuator/**
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
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ const I18N_CONF = {
healthCheckPatternService: '服务端',
healthCheckPatternClient: '客户端',
healthCheckPatternNone: '禁止',
serviceNameRequired: '请输入服务名',
protectThresholdRequired: '请输入保护阈值',
healthCheckModeRequired: '请选择健康检查模式',
},
InstanceTable: {
operation: '操作',
Expand Down Expand Up @@ -311,6 +314,7 @@ const I18N_CONF = {
editNamespace: '加载中...',
load: '命名空间名:',
namespace: '命名空间不能为空',
namespaceDesc: '命名空间描述不能为空',
description: '描述:',
},
ExportDialog: {
Expand Down Expand Up @@ -365,6 +369,7 @@ const I18N_CONF = {
loading: '加载中...',
name: '命名空间名:',
namespacenotnull: '命名空间不能为空',
namespacedescnotnull: '命名空间描述不能为空',
description: '描述:',
},
NameSpaceList: {
Expand Down
Loading

0 comments on commit ffb8720

Please sign in to comment.