Skip to content

Commit 8e10cfe

Browse files
authored
Merge pull request #225 from scouter-contrib/development
Development
2 parents 6387716 + 090ea93 commit 8e10cfe

File tree

33 files changed

+1692
-250
lines changed

33 files changed

+1692
-250
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ You can download the latest version from the page below.
3030
## Guides
3131
- [Home Page](https://scouter-contrib.github.io/scouter-paper/)
3232
- [User Guide](https://translate.google.co.kr/translate?sl=ko&tl=en&js=y&prev=_t&hl=ko&ie=UTF-8&u=https%3A%2F%2Fscouter-contrib.github.io%2Fscouter-paper%2Fmanual.html&edit-text=&act=url)
33+
34+
## DockerHub
35+
- [scouter-paper](https://hub.docker.com/r/scouterapm/scouter-paper)
3336

3437
## Screenshots
3538
- HOME

README_kr.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ build를 위해서 먼저 npm이 설치되어 있어야합니다.
3030
## 가이드
3131
- [소개 페이지](https://scouter-contrib.github.io/scouter-paper/)
3232
- [사용자 가이드](./build/help/manual.html)
33-
33+
34+
## 도커허브
35+
- [scouter-paper](https://hub.docker.com/r/scouterapm/scouter-paper)
36+
3437
## 주요 화면
3538
- HOME
3639

src/App.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,9 @@ class App extends Component {
331331
let found = false;
332332
for (let i=0; i<config.servers.length; i++) {
333333
let server = config.servers[i];
334-
if (server.protocol === paramProtocol && server.address === paramAddress && String(server.port) === String(paramPort) && server.authentification === paramAuthentification) {
334+
if (server.protocol === paramProtocol && server.address === paramAddress
335+
&& String(server.port) === String(paramPort))
336+
{
335337
found = true;
336338
server.default = true;
337339
} else {

src/Theme.css

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,16 @@ html.theme-gray, .theme-gray body {
146146
color: white;
147147
}
148148

149+
.theme-gray .scrollbar::-webkit-scrollbar {
150+
width: 7px;
151+
height: 7px;
152+
background-color: rgba(0, 0, 0, 0.4);
153+
}
154+
155+
.theme-gray .scrollbar::-webkit-scrollbar-thumb {
156+
background-color: #FCDC3B;
157+
}
158+
149159
/* THEME, Menu.css */
150160
.theme-gray .menu-div {
151161
background-color: #222;
@@ -285,6 +295,9 @@ html.theme-gray, .theme-gray body {
285295
.theme-gray .frame-profile div.xlog-data span.label {
286296
background-color: #111;
287297
}
298+
.theme-gray .frame-profile div.time-ratio{
299+
background-color: #111;
300+
}
288301

289302
.theme-gray .frame-xlog-steps .step {
290303
background-color: #111;
@@ -318,4 +331,18 @@ html.theme-gray, .theme-gray body {
318331
.theme-gray .frame-profile-step-detail .sub-detail-title .sql-btns > div {
319332
background-color: rgba(255,255,255,0.4);
320333
color: white;
321-
}
334+
}
335+
336+
/* ProfileList.css */
337+
.xlog-profile-list > div.header.row.fixed > span {
338+
position: sticky;
339+
top: 0;
340+
background-color: #F2F2F2;
341+
}
342+
343+
.theme-gray .xlog-profile-list > div.header.row.fixed > span {
344+
position: sticky;
345+
top: 0;
346+
background-color: #111;
347+
}
348+

src/actions/index.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ export const SET_TEMPLATE_NAME = 'SET_TEMPLATE_NAME';
4343
export const SET_PRESET_NAME = 'SET_PRESET_NAME';
4444
export const SET_LAYOUT_NAME = 'SET_LAYOUT_NAME';
4545

46+
47+
export const SET_TIME_FOCUS = 'SET_TIME_FOCUS';
48+
4649
export function setTemplateName(preset, layout) {
4750
return {
4851
type: SET_TEMPLATE_NAME,
@@ -269,13 +272,14 @@ export function setRangeDateHoursMinutes(date, hours, minutes) {
269272
};
270273
}
271274

272-
export function setRangeDateHoursMinutesValue(date, hours, minutes, value) {
275+
export function setRangeDateHoursMinutesValue(date, hours, minutes, value, fromPast) {
273276
return {
274277
type: SET_RANGE_DATE_HOURS_MINUTES_VALUE,
275278
date : date,
276279
hours : hours,
277280
minutes : minutes,
278-
value : value
281+
value : value,
282+
fromPast : fromPast
279283
};
280284
}
281285

@@ -364,3 +368,13 @@ export function setActiveServiceList(object){
364368
object : object
365369
}
366370
}
371+
export function setTimeFocus(active,time,boxKey,keep=false){
372+
return {
373+
type : SET_TIME_FOCUS,
374+
id: boxKey,
375+
active :active,
376+
time : time,
377+
keep : keep
378+
}
379+
380+
}

src/common/common.js

Lines changed: 122 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// local storage access
22
import moment from "moment";
33
import {Dictionary, DictType} from "./dictionary";
4-
export const version = "2.4.0";
4+
export const version = "2.5.0";
55

66
export function getData(key) {
77
let ls = null;
@@ -67,6 +67,19 @@ export function getHttpProtocol(config) {
6767
}
6868
}
6969

70+
export function getServerInfo(config) {
71+
if (config.servers && config.servers.length > 0) {
72+
let server = config.servers.filter((server) => server.default);
73+
if (server && server.length > 0) {
74+
return { address: server[0].address, port: server[0].port };
75+
} else {
76+
return null;
77+
}
78+
} else {
79+
return null;
80+
}
81+
}
82+
7083
export function buildHttpProtocol(config) {
7184
if (config.servers && config.servers.length > 0) {
7285
let idx = 0;
@@ -332,6 +345,25 @@ export function getParam(props, key) {
332345
}
333346
}
334347

348+
export function setXlogfilterToUrl (props, filter) {
349+
350+
let search = new URLSearchParams(props.location.search);
351+
352+
if(filter === null) {
353+
search.delete("xlogfilter");
354+
}else{
355+
search.set("xlogfilter", JSON.stringify(filter));
356+
}
357+
358+
if (props.location.search !== ("?" + search.toString())) {
359+
props.history.replace({
360+
pathname: props.location.pathname,
361+
search: "?" + search.toString()
362+
});
363+
}
364+
365+
}
366+
335367
export function setRangePropsToUrl (props, pathname, objects) {
336368
let search = new URLSearchParams(props.location.search);
337369

@@ -363,6 +395,7 @@ export function setRangePropsToUrl (props, pathname, objects) {
363395

364396
search.set("from", from.format("YYYYMMDDHHmmss"));
365397
search.set("to", to.format("YYYYMMDDHHmmss"));
398+
search.set("fromPast", props.range.fromPast);
366399

367400
if (props.location.search !== ("?" + search.toString())) {
368401
if (pathname) {
@@ -398,6 +431,94 @@ export function setTxidPropsToUrl (props, txiddate, txid) {
398431
}
399432
}
400433

434+
export function setTargetServerToUrl (props, config, anotherParam) {
435+
const server = getServerInfo(config);
436+
if (server && server.address) {
437+
setTargetServerToUrl0(props, server.address, server.port, server.protocol, anotherParam);
438+
}
439+
}
440+
441+
const ALL_OPTIONS_OF_SERVER_KEY = "allOptionsOfServer";
442+
443+
export function clearAllUrlParamOfPaper (props, config) {
444+
props.history.push({
445+
pathname: props.location.pathname
446+
});
447+
}
448+
449+
export function replaceAllLocalSettingsForServerChange (currentServer, props, config) {
450+
if (currentServer && currentServer.address) {
451+
saveCurrentAllLocalSettings(currentServer, config);
452+
reloadAllLocalSettingsOfServer(props, config);
453+
}
454+
}
455+
456+
export function saveCurrentAllLocalSettings (currentServer, config) {
457+
const serverKey = currentServer.address + ":" + currentServer.port;
458+
459+
const option = {
460+
server: serverKey,
461+
options: {
462+
selectedObjects : getData("selectedObjects"),
463+
templateName : getData("templateName"),
464+
layouts : getData("layouts"),
465+
boxes : getData("boxes"),
466+
preset : getData("preset"),
467+
profileOptions : getData("profileOptions"),
468+
topologyPosition : getData("topologyPosition"),
469+
topologyOptions : getData("topologyOptions"),
470+
alert : getData("alert")
471+
}
472+
};
473+
474+
const allOptionsOfServer = getData(ALL_OPTIONS_OF_SERVER_KEY) || [];
475+
let allOptions = allOptionsOfServer.filter(option => option.server !== serverKey);
476+
allOptions.push(option);
477+
478+
setData(ALL_OPTIONS_OF_SERVER_KEY, allOptions);
479+
}
480+
481+
export function reloadAllLocalSettingsOfServer (props, config) {
482+
const server = getServerInfo(config);
483+
if (server && server.address) {
484+
const serverKey = server.address + ":" + server.port;
485+
const allOptionsOfServer = getData(ALL_OPTIONS_OF_SERVER_KEY) || [];
486+
const option = allOptionsOfServer.filter(option => option["server"] === serverKey);
487+
488+
if (option && option[0] && option[0].options) {
489+
setData("selectedObjects", option[0].options["selectedObjects"]);
490+
setData("templateName", option[0].options["templateName"]);
491+
setData("layouts", option[0].options["layouts"]);
492+
setData("boxes", option[0].options["boxes"]);
493+
setData("preset", option[0].options["preset"]);
494+
setData("profileOptions", option[0].options["profileOptions"]);
495+
setData("topologyPosition", option[0].options["topologyPosition"]);
496+
setData("topologyOptions", option[0].options["topologyOptions"]);
497+
setData("alert", option[0].options["alert"]);
498+
}
499+
}
500+
}
501+
502+
export function setTargetServerToUrl0 (props, serverAddr, serverPort, protocol, anotherParam) {
503+
let search = new URLSearchParams(props.location.search);
504+
505+
search.set("address", serverAddr);
506+
search.set("port", serverPort);
507+
search.set("protocol", protocol || "http");
508+
for (let key in anotherParam) {
509+
if (anotherParam[key]) {
510+
search.set(key, anotherParam[key]);
511+
}
512+
}
513+
514+
if (props.location.search !== ("?" + search.toString())) {
515+
props.history.replace({
516+
pathname: props.location.pathname,
517+
search: "?" + search.toString()
518+
});
519+
}
520+
}
521+
401522
const table = [
402523
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
403524
0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,

src/components/Box/Tooltip/Tooltip.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class Tooltip extends Component {
7272
<div ref="tooltipRoot" className={"tooltip " + (hasData ? '' : 'no-data')} style={{left: x, top: y}}>
7373
{show && this.props.tooltip.data &&
7474
<div>
75-
<div className="time">{this.props.tooltip.data.time}</div>
75+
<div className="time">{this.props.tooltip.data.time} {`${this.props.tooltip.data.chartType === "STACK AREA" ? "Sum :"+this.props.tooltip.data.counterSum : "" }`}</div>
7676
<ul>
7777
{this.props.tooltip.data.lines.map((d, i) => {
7878
return (

src/components/Controller/Controller.css

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,14 @@
121121
}
122122

123123
.controller-wrapper .control-item.first {
124+
z-index: 3;
125+
}
126+
127+
.controller-wrapper .control-item.control-item-search {
128+
z-index: 2;
129+
}
130+
131+
.controller-wrapper .control-item.control-item-calendar {
124132
z-index: 1;
125133
}
126134

@@ -159,20 +167,27 @@
159167
display: inline-block;
160168
margin-left: 10px;
161169
position: absolute;
162-
top : 2px;
170+
top : 3px;
171+
right : 10px;
172+
font-size: 10px;
163173
}
164174

165175
.controller-wrapper .control-item .row > div.row-message .breakpoints .breakpoint {
166176
display: inline-block;
167-
padding: 2px 4px;
177+
padding-top: 1px;
178+
text-align: center;
179+
width: 14px;
180+
height: 14px;
181+
border-radius: 50%;
182+
box-sizing: border-box;
168183
}
169184

170185
.controller-wrapper .control-item .row > div.row-message .breakpoints .breakpoint:first-child {
171-
border-radius: 2px 0 0 2px;
186+
_border-radius: 5px 0 0 5px;
172187
}
173188

174189
.controller-wrapper .control-item .row > div.row-message .breakpoints .breakpoint:last-child {
175-
border-radius: 0 2px 2px 0;
190+
_border-radius: 0 5px 5px 0;
176191
}
177192

178193
.controller-wrapper .control-item .row > div.row-message .breakpoints .breakpoint.selected {

0 commit comments

Comments
 (0)