Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support upload trace in Zipkin Lens UI #2447

Merged
merged 11 commits into from
Mar 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions zipkin-lens/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions zipkin-lens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"react": "^16.4.1",
"react-chartjs-2": "^2.7.4",
"react-dom": "^16.4.1",
"react-modal": "^3.8.1",
"react-numeric-input": "^2.2.3",
"react-redux": "^5.0.7",
"react-router": "^4.3.1",
Expand Down
13 changes: 0 additions & 13 deletions zipkin-lens/scss/components/_condition-trace-id.scss

This file was deleted.

80 changes: 80 additions & 0 deletions zipkin-lens/scss/components/_global-dropdown-menu.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
.global-dropdown-menu {
height: 50px;
display: flex;
align-items: center;
}

.global-dropdown-menu__modal-wrapper {
position:relative;
}

.global-dropdown-menu__button {
width: 35px;
height: 35px;
font-size: 24px;
border-radius: 3px;
border: solid 1px $gray-7;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
background: linear-gradient(to bottom, $gray-10, $gray-9);
}

.global-dropdown-menu__modal {
}

.global-dropdown-menu__overlay {
position: absolute;
right: 0;
top: 20px;
background-color: $white;
border: solid $gray-7 1px;
border-radius: 3px;
overflow: hidden;
}

.global-dropdown-menu__trace-id {
width: 100%;
padding: 3px 4px 6px 4px;
box-sizing: border-box;
border-bottom: 1px solid $gray-7;
}

.global-dropdown-menu__trace-id-label {
font-size: 16px;
}

.global-dropdown-menu__trace-id-search {
display: flex;
}

.global-dropdown-menu__trace-id-input {
border: solid $gray-8 1px;
border-radius: 2px;
height: 18px;
width: 160px;
margin-right: 3px;
}

.global-dropdown-menu__trace-id-button {
width: 20px;
height: 20px;
background: linear-gradient(to bottom, $gray-10, $gray-9);
display: flex;
justify-content: center;
align-items: center;
border-radius: 3px;
border: solid 1px $gray-7;
cursor: pointer;
}

.global-dropdown-menu__trace-json {
font-size: 16px;
padding: 3px 4px 3px 4px;
box-sizing: border-box;
cursor: pointer;
&:hover {
background-color: $gray-10;
}
}
4 changes: 4 additions & 0 deletions zipkin-lens/scss/components/_global-search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@
background: linear-gradient(to bottom, $gray-10, $gray-9);
}

.global-search__dropdown-menu-wrapper {
margin-left: 10px;
}

.global-search__find-button {
width: 28px;
height: 28px;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
.mini-trace-viewer {
.mini-timeline {
width: 96%;
padding: 2px;
margin: 5px;
}

.mini-trace-viewer__time-markers-wrapper {
.mini-timeline__time-marker-labels-wrapper {
position: relative;
height: 14px;
}

.mini-trace-viewer__time-marker {
.mini-timeline__time-marker {
position: absolute;
}

.mini-trace-viewer__time-marker-label {
.mini-timeline__time-marker-label {
color: $dark-2;
font-size: $font-size-xs;
position: absolute;
left: -20px;

&.first {
&--first {
left: 2px;
position: absolute;
}

&.last {
&--last {
left: initial;
right: 2px;
position: absolute;
}
}

.mini-trace-viewer__graph {
.mini-timeline__graph {
padding: 2px;
background-color: $gray-10;
height: 75px;
Expand Down
3 changes: 3 additions & 0 deletions zipkin-lens/scss/components/_trace-page.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.trace-page {

}
17 changes: 17 additions & 0 deletions zipkin-lens/scss/components/_trace-viewer.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.trace-viewer {

}

.trace-viewer__error-message-wrapper {
display: flex;
justify-content: center;
}

.trace-viewer__error-message {
margin-top: 5px;
padding: 10px;
opacity: 0.75;
background-color: #ff0000;
color: $white;
border-radius: 5px;
}
12 changes: 12 additions & 0 deletions zipkin-lens/scss/custom/_react-modal.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.ReactModal__Overlay {
opacity: 0;
transition: opacity 200ms ease-in-out;
}

.ReactModal__Overlay--after-open {
opacity: 1;
}

.ReactModal__Overlay--before-close {
opacity: 0;
}
7 changes: 5 additions & 2 deletions zipkin-lens/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

@import 'custom/rc-calendar';
@import 'custom/rc-time-picker';
@import 'custom/react-modal';
@import 'custom/react-select';
@import 'custom/vizceral';

Expand All @@ -19,19 +20,21 @@
@import 'components/condition-lookback';
@import 'components/condition-name';
@import 'components/condition-tags';
@import 'components/condition-trace-id';
@import 'components/date-picker';
@import 'components/dependencies-sidebar';
@import 'components/dependencies';
@import 'components/detailed-trace-summary';
@import 'components/global-dropdown-menu';
@import 'components/global-search';
@import 'components/loading-overlay';
@import 'components/mini-trace-viewer';
@import 'components/mini-timeline';
@import 'components/search-condition';
@import 'components/service-name-badge';
@import 'components/sidebar';
@import 'components/timeline';
@import 'components/timeline-header';
@import 'components/timeline-span';
@import 'components/timeline-span-data';
@import 'components/trace-page';
@import 'components/trace-summary';
@import 'components/trace-viewer';
11 changes: 11 additions & 0 deletions zipkin-lens/src/actions/trace-viewer-action.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import * as types from '../constants/action-types';

export const loadTrace = trace => ({
type: types.TRACE_VIEWER__LOAD_TRACE,
trace,
});

export const loadTraceFailure = message => ({
type: types.TRACE_VIEWER__LOAD_TRACE_FAILURE,
message,
});
23 changes: 23 additions & 0 deletions zipkin-lens/src/actions/trace-viewer.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import * as actions from './trace-viewer-action';
import * as types from '../constants/action-types';

describe('trace viewer actions', () => {
it('should create an action to set the trace', () => {
const trace = {};
const expectedAction = {
type: types.TRACE_VIEWER__LOAD_TRACE,
trace,
};
expect(actions.loadTrace(trace)).toEqual(expectedAction);
});

it('should create an action to set the error message', () => {
const expectedAction = {
type: types.TRACE_VIEWER__LOAD_TRACE_FAILURE,
message: 'This is an error message',
};
expect(
actions.loadTraceFailure('This is an error message'),
).toEqual(expectedAction);
});
});
12 changes: 10 additions & 2 deletions zipkin-lens/src/components/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { BrowserRouter, Route } from 'react-router-dom';

import Layout from './Layout';
import BrowserContainer from '../../containers/Browser/BrowserContainer';
import DetailedTraceSummaryContainer from '../../containers/DetailedTraceSummary/DetailedTraceSummaryContainer';
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';
Expand All @@ -31,7 +32,7 @@ class App extends React.Component {
exact
path="/zipkin/traces/:traceId"
render={props => (
<DetailedTraceSummaryContainer {...props} />
<TracePageContainer {...props} />
)}
/>
<Route
Expand All @@ -41,6 +42,13 @@ class App extends React.Component {
<DependenciesContainer {...props} />
)}
/>
<Route
exact
path="/zipkin/traceViewer"
render={props => (
<TraceViewerContainer {...props} />
)}
/>
</Layout>
</BrowserRouter>
</Provider>
Expand Down
Loading