Skip to content

Commit

Permalink
fix: closes #1476
Browse files Browse the repository at this point in the history
  • Loading branch information
loadchange committed Jul 4, 2019
2 parents 49027b8 + 38866a4 commit b29953a
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 16 deletions.
4 changes: 3 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 @@ -43,6 +43,7 @@ import ServiceList from './pages/ServiceManagement/ServiceList';
import ServiceDetail from './pages/ServiceManagement/ServiceDetail';
import SubscriberList from './pages/ServiceManagement/SubscriberList';
import ClusterNodeList from './pages/ClusterManagement/ClusterNodeList';
import Welcome from './pages/Welcome/Welcome';

import reducers from './reducers';
import { changeLanguage } from './reducers/locale';
Expand Down Expand Up @@ -70,7 +71,8 @@ const store = createStore(
);

const MENU = [
{ path: '/', exact: true, render: () => <Redirect to="/configurationManagement" /> },
{ path: '/', exact: true, render: () => <Redirect to="/welcome" /> },
{ path: '/welcome', component: Welcome },
{ path: '/namespace', component: Namespace },
{ path: '/newconfig', component: Newconfig },
{ path: '/configsync', component: Configsync },
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* 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.
*/

import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { Redirect } from 'react-router-dom';

@connect(state => ({ ...state.base }))
class Welcome extends React.Component {
static propTypes = {
functionMode: PropTypes.string,
};

render() {
const { functionMode } = this.props;
return (
<div>
{functionMode !== '' && (
<Redirect
to={`/${functionMode === 'naming' ? 'serviceManagement' : 'configurationManagement'}`}
/>
)}
</div>
);
}
}

export default Welcome;
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* 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.
*/

import Welcome from './Welcome';

export default Welcome;
2 changes: 1 addition & 1 deletion console/src/main/resources/static/css/main.css

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions console/src/main/resources/static/js/main.js

Large diffs are not rendered by default.

0 comments on commit b29953a

Please sign in to comment.