Skip to content

Commit

Permalink
# fix 156
Browse files Browse the repository at this point in the history
Slove 404 problem
  • Loading branch information
yanlinly committed Oct 26, 2018
1 parent f9959e1 commit 90e5c95
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 848 deletions.
4 changes: 2 additions & 2 deletions console/src/main/resources/static/public/i18ndoc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
window.i18ndoc = {
"zh-cn": {
"com.alibaba.nacos.layout.noenv.nacosversion":"1.0",
"com.alibaba.nacos.layout.noenv.nacosversion":"0.3.0",
"com.alibaba.nacos.page.configurationManagementVirtual":"配置管理",
"com.alibaba.nacos.page.serviceManagementVirtual":"服务管理",
"nacos.component.ExportDialog.tags2": "标签:",
Expand Down Expand Up @@ -513,7 +513,7 @@ window.i18ndoc = {
"nacos.page.ConfigEditor.submit_failed": "不能为空, 提交失败",
},
"en-us": {
"com.alibaba.nacos.layout.noenv.nacosversion":"1.0",
"com.alibaba.nacos.layout.noenv.nacosversion":"0.3.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 @@ -81,20 +81,7 @@ class NameSpaceList extends React.Component {
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);
}
this.handleNameSpaces(res.data);
} else {
Dialog.alert({
language: window.pageLanguage || 'zh-cn',
Expand All @@ -105,11 +92,6 @@ class NameSpaceList extends React.Component {
},
error: res => {
window.namespaceList = [];
// window.namespaceList = [{
// "namespace": "",
// "namespaceShowName": "公共空间",
// "type": 0
// }];
this.handleNameSpaces(window.namespaceList);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ class NewNameSpace extends React.Component {
this.setState({
disabled: false
});
debugger;
if (res === true) {
this.closeDialog();
this.props.getNameSpaces();
Expand All @@ -116,21 +115,7 @@ class NewNameSpace extends React.Component {
});
});
}
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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,25 +98,18 @@ public class ConfigController {

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.
*/
* Demo for Nacos
* pom.xml
<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-client</artifactId>
<version>\${version}</version>
</dependency>
*/
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;
Expand All @@ -135,7 +128,7 @@ public class ConfigExample {
String dataId = "${data.dataId}";
String group = "${data.group}";
Properties properties = new Properties();
properties.put("serverAddr", serverAddr);
properties.put(PropertyKeyConst.SERVER_ADDR, serverAddr);
ConfigService configService = NacosFactory.createConfigService(properties);
String content = configService.getConfig(dataId, group, 5000);
System.out.println(content);
Expand Down
16 changes: 10 additions & 6 deletions console/src/main/resources/static/src/layouts/MainLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,12 +380,16 @@ export default class MainLayout extends React.Component {
'com.alibaba.nacos.layout.noenv.app_configuration_management_acm'
)}
>
{window.aliwareIntl.get(
'com.alibaba.nacos.layout.noenv.app_configuration_management_acm'
)}
{window.aliwareIntl.get(
'com.alibaba.nacos.layout.noenv.nacosversion'
)}
<span>
{window.aliwareIntl.get(
'com.alibaba.nacos.layout.noenv.app_configuration_management_acm'
)}
</span>
<span style={{ marginLeft: 5 }}>
{window.aliwareIntl.get(
'com.alibaba.nacos.layout.noenv.nacosversion'
)}
</span>
</div>
)}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class ConfigDetail extends React.Component {
});
}
this.getDataDetail();
// this.getTags();
}
openLoading() {
this.setState({
Expand All @@ -48,64 +47,7 @@ class ConfigDetail extends React.Component {
loading: false
});
}
getTags() {
let self = this;
this.tenant = window.getParams('namespace') || '';
this.serverId = window.getParams('serverId') || 'center';
let url = `/diamond-ops/configList/configTags/serverId/${this.serverId}/dataId/${this.dataId}/group/${this.group}/tenant/${this.tenant}?id=`;
if (this.tenant === 'global' || !this.tenant) {
url = `/diamond-ops/configList/configTags/serverId/${this.serverId}/dataId/${this.dataId}/group/${this.group}?id=`;
}
window.request({
url: url,
beforeSend: function () {
self.openLoading();
},
success: function (result) {

if (result.code === 200) {

if (result.data.length > 0) {
//如果存在beta
let tag = [{ title: window.aliwareIntl.get('com.alibaba.nacos.page.configdetail.official'), key: 'normal' }, { title: 'BETA', key: 'beta' }];
self.setState({
tag: tag,
hasbeta: true
});
self.getBeta();
}
} else { }
},
complete: function () {
self.closeLoading();
}
});
}
getBeta() {

let self = this;
this.tenant = window.getParams('namespace') || '';
this.serverId = window.getParams('serverId') || 'center';
let url = `/diamond-ops/configList/edit/beta/serverId/${this.serverId}/dataId/${this.dataId}/group/${this.group}/tenant/${this.tenant}?id=`;
if (this.tenant === 'global' || !this.tenant) {
url = `/diamond-ops/configList/edit/beta/serverId/${this.serverId}/dataId/${this.dataId}/group/${this.group}?id=`;
}
window.request({
url: url,
beforeSend: function () {
self.openLoading();
},
success: function (result) {

if (result.code === 200) {
self.valueMap['beta'] = result.data;
} else { }
},
complete: function () {
self.closeLoading();
}
});
}

changeTab(value) {

let self = this;
Expand Down
Loading

0 comments on commit 90e5c95

Please sign in to comment.