forked from openzipkin/zipkin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
52 changed files
with
1,286 additions
and
1,150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You 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 { Provider } from 'react-redux'; | ||
import { BrowserRouter, Route } from 'react-router-dom'; | ||
|
||
import Layout from './Layout'; | ||
import BrowserContainer from '../../containers/Browser/BrowserContainer'; | ||
import TracePageContainer from '../../containers/TracePage/TracePageContainer'; | ||
import DependenciesContainer from '../../containers/Dependencies/DependenciesContainer'; | ||
import TraceViewerContainer from '../../containers/TraceViewer/TraceViewerContainer'; | ||
import configureStore from '../../store/configure-store'; | ||
|
||
const applicationTitle = 'Zipkin'; | ||
|
||
class App extends React.Component { | ||
componentDidMount() { | ||
document.title = applicationTitle; | ||
} | ||
|
||
render() { | ||
return ( | ||
<Provider store={configureStore()}> | ||
<BrowserRouter> | ||
<Layout> | ||
<Route | ||
exact | ||
path="/zipkin/" | ||
component={BrowserContainer} | ||
/> | ||
<Route | ||
exact | ||
path="/zipkin/traces/:traceId" | ||
component={TracePageContainer} | ||
/> | ||
<Route | ||
exact | ||
path="/zipkin/dependency" | ||
component={DependenciesContainer} | ||
/> | ||
<Route | ||
exact | ||
path="/zipkin/traceViewer" | ||
render={TraceViewerContainer} | ||
/> | ||
</Layout> | ||
</BrowserRouter> | ||
</Provider> | ||
); | ||
} | ||
} | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You 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 PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
import { withRouter } from 'react-router'; | ||
import Cookies from 'js-cookie'; | ||
|
||
import SidebarPageOption from './SidebarPageOption'; | ||
import Logo from '../../../img/zipkin-logo.svg'; | ||
|
||
const propTypes = { | ||
location: PropTypes.shape({ pathname: PropTypes.string }).isRequired, | ||
history: PropTypes.shape({ push: PropTypes.func.isRequired }).isRequired, | ||
}; | ||
|
||
class Sidebar extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.goBackToClassic = this.goBackToClassic.bind(this); | ||
} | ||
|
||
goBackToClassic(event) { | ||
const { location, history } = this.props; | ||
|
||
Cookies.remove('lens'); | ||
if (location.pathname === '/zipkin') { | ||
history.push('/zipkin/'); | ||
} else { | ||
history.push(`${location.pathname}`); | ||
} | ||
window.location.reload(true); | ||
event.preventDefault(); | ||
} | ||
|
||
render() { | ||
const { location } = this.props; | ||
return ( | ||
<div className="sidebar"> | ||
<div | ||
to={{ pathname: '' }} | ||
className="sidebar__brand-link" | ||
> | ||
<Logo className="sidebar__brand-logo" /> | ||
</div> | ||
<div className="sidebar__menu"> | ||
<SidebarPageOption location={location} pageName="browser" /> | ||
<SidebarPageOption location={location} pageName="dependencies" /> | ||
</div> | ||
{ | ||
Cookies.get('lens') | ||
? ( | ||
<div className="sidebar__go-back-to-classic-button-wrapper"> | ||
<button | ||
type="button" | ||
className="sidebar__go-back-to-classic-button" | ||
onClick={this.goBackToClassic} | ||
> | ||
Go back to classic Zipkin | ||
</button> | ||
</div> | ||
) | ||
: null | ||
} | ||
<div className="sidebar__other-links"> | ||
<a href="https://zipkin.apache.org/" target="_blank" rel="noopener noreferrer"> | ||
<div className="sidebar__other-link fas fa-home" /> | ||
</a> | ||
<a href="https://github.com/openzipkin/zipkin" target="_blank" rel="noopener noreferrer"> | ||
<div className="sidebar__other-link fab fa-github" /> | ||
</a> | ||
<a href="https://twitter.com/zipkinproject" target="_blank" rel="noopener noreferrer"> | ||
<div className="sidebar__other-link fab fa-twitter" /> | ||
</a> | ||
<a href="https://gitter.im/openzipkin/zipkin/" target="_blank" rel="noopener noreferrer"> | ||
<div className="sidebar__other-link fab fa-gitter" /> | ||
</a> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
Sidebar.propTypes = propTypes; | ||
|
||
export default withRouter(Sidebar); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.