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

Globalping: web tools UI changes; infinite mode #624

Merged
merged 580 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
580 commits
Select commit Hold shift + click to select a range
3570a18
Mod makeHTTPRequest to return response status code on err
xbpcb Mar 18, 2024
8467534
Mod getGlobalpingMeasurement: rm redundant param
xbpcb Mar 18, 2024
1b2b117
Gp: fix getGlobalpingMeasurement impl
xbpcb Mar 18, 2024
63ab80f
Mod makeHTTPRequest: disable es-lint rule
xbpcb Mar 18, 2024
b23582e
Gp: fix getTestMeasurementById err handling
xbpcb Mar 18, 2024
a1edf50
Gp: handle run-out-of-credits error
xbpcb Mar 18, 2024
2a70a51
GpResTable: rename props
xbpcb Mar 19, 2024
b55a60e
GpResTable: mod isFailed, fix quality for infinite case
xbpcb Mar 19, 2024
c1c118b
GpTableOutput: get probe statuses, rm redundant code
xbpcb Mar 20, 2024
1862200
GpTableOutput: scaffold skeleton usage
xbpcb Mar 20, 2024
1d82ef7
GpResTable: fix quality str
xbpcb Mar 21, 2024
33cbbb1
GpResTable: fix timings str display
xbpcb Mar 21, 2024
0f77eb8
Gp: mod display type switch logic
xbpcb Mar 21, 2024
a1bbd67
PlaceholderSkeleton: mod styles
xbpcb Mar 21, 2024
460d087
GpResTable: mod skeleton styles
xbpcb Mar 21, 2024
0cc9ff0
Linter fix
xbpcb Mar 21, 2024
fc9cc2d
Gp: fix test stop on run out of credits
xbpcb Mar 22, 2024
d8c6403
GpResTable: show skeleton for graph cell, mod createGraph impl
xbpcb Mar 22, 2024
2613b58
GpResTable: mod styles
xbpcb Mar 22, 2024
e4db1b0
GpResTable: fix consts usage
xbpcb Mar 22, 2024
bd77533
Mod parseGpRawOutputForTimings logic
xbpcb Mar 22, 2024
ee47b85
GpResTable: mod infinite timings logic, show time out packets on graph
xbpcb Mar 22, 2024
a3bdba4
GpResTable: rename func
xbpcb Mar 22, 2024
ef1c613
GpResTable: mod regular res flow, add todos
xbpcb Mar 25, 2024
ee59a92
GpResTable: fix regular graph logic
xbpcb Mar 25, 2024
6deba16
Linter fix
xbpcb Mar 25, 2024
c19b3b7
GpResTable: mod offline handling, temp
xbpcb Mar 26, 2024
5e8a29b
GpResTable: mod regular res handling
xbpcb Mar 26, 2024
9f5d0ce
GpResTable: dont show graph when no data fix
xbpcb Mar 26, 2024
2776806
GpResTable: fix regular res handling
xbpcb Mar 26, 2024
9e74053
GpResTable: fix regular res handling
xbpcb Mar 26, 2024
54eb3c5
GpResTable: fix status line olor handling
xbpcb Mar 27, 2024
040a173
GpResTable: mod code
xbpcb Mar 27, 2024
0098361
GpResTable: rm commented
xbpcb Mar 27, 2024
26a2509
GpResTable: init styles mod, mod header
xbpcb Mar 28, 2024
63f4284
GpResTable: revisit styles and html
xbpcb Mar 28, 2024
071ae19
GpResTable: fix styles
xbpcb Mar 28, 2024
285c141
GpResTable: fix styles
xbpcb Mar 28, 2024
6052d59
Gp: fix regular measurement req flow
xbpcb Mar 28, 2024
59a1e05
Gp: fix case when no location value presented
xbpcb Mar 28, 2024
d5bddea
Fix calcGpTestResTiming offline case
xbpcb Mar 29, 2024
db8af0a
GpResTable: failed case, fix offline case for reg measurement
xbpcb Mar 29, 2024
c7ec494
Fix
xbpcb Mar 29, 2024
8da6dfe
Fix calcGpTestResTiming isFailed value
xbpcb Mar 29, 2024
ff1f17a
GpResTable: replace redundant js code with css
xbpcb Mar 29, 2024
9627337
GpResTable: small code fixes
xbpcb Mar 29, 2024
059388f
GpResTable: fix infinite meas timings
xbpcb Mar 29, 2024
0f05b83
Gp,GpResTable: fix results and actions btn
xbpcb Mar 29, 2024
d32be1b
TagsInput: fix styles
xbpcb Apr 1, 2024
da551fa
Gp: regroup elements on the page, start to mod styles
xbpcb Apr 1, 2024
87bbf16
Gp, TAgsInput: mv styles rules to parent el styles
xbpcb Apr 1, 2024
c2db46d
Gp, TAgsInput: mod styles
xbpcb Apr 1, 2024
45331e4
Gp: fix location styles
xbpcb Apr 2, 2024
2289bbe
Gp: fix runTest btn styles
xbpcb Apr 2, 2024
897f0ce
GpResCtrls: fix styles
xbpcb Apr 2, 2024
f367ca1
GpResCtrls: fix styles
xbpcb Apr 2, 2024
a5a0a47
GpResTAble: start to fix mobile styles
xbpcb Apr 3, 2024
555274c
GpResTable: mod timings str logic, fix single target mobile styles
xbpcb Apr 3, 2024
02effef
GpResTable: fix timings styles, logi on mobile
xbpcb Apr 3, 2024
1234853
GpResTAble: fix timings styles
xbpcb Apr 3, 2024
d366513
GpResTAble: fix skeleton styles
xbpcb Apr 3, 2024
114c2e9
GpResTable: fix skeleton styles
xbpcb Apr 4, 2024
9e019bf
GpResTAble: fix medium styles
xbpcb Apr 4, 2024
18f6a89
GpResTable: fix targets styles for lg
xbpcb Apr 4, 2024
cba0801
GpResTable: mod md styles
xbpcb Apr 4, 2024
32c7d4c
GpResTAble: fix linter issues
xbpcb Apr 4, 2024
a705d6e
Gp: mod html structure
xbpcb Apr 4, 2024
e78e226
Gp: mod btn html, styles
xbpcb Apr 4, 2024
516ac94
Gp: fix settings block, btn styles
xbpcb Apr 4, 2024
8f24aff
Gp: fix settings styles
xbpcb Apr 4, 2024
9f01a3e
Gp: fix settings styles
xbpcb Apr 5, 2024
479f182
Gp: fix location input styles
xbpcb Apr 5, 2024
c3ae378
TagsInput: small fix
xbpcb Apr 5, 2024
72398f9
Merge branch 'master' into gh-592
MartinKolarik Apr 5, 2024
e813c40
Gp: fix settings styles for lg
xbpcb Apr 8, 2024
9385af7
Header: fix dropdown menu styles on focus
xbpcb Apr 8, 2024
f5251c2
Merge branch 'gh-592' of https://github.com/jsdelivr/www.jsdelivr.com…
xbpcb Apr 8, 2024
372d9f7
GpResTable: fix raw output on failure
xbpcb Apr 9, 2024
55c564a
Gp: rename vars, fix comments
xbpcb Apr 12, 2024
17d94b1
Gp: mod comments, fix infinite flow markers data handling
xbpcb Apr 12, 2024
c880d2c
Gp: mod markers IW timing handling for infinite
xbpcb Apr 15, 2024
1d0a2d3
Gp: small style fix to marker IW for 2 targets
xbpcb Apr 15, 2024
cfee05b
Gp: infinite flow timings logic
xbpcb Apr 18, 2024
7672cb7
Small fix
xbpcb Apr 19, 2024
cab78b2
Gp: mv map marker svg creation to a separate func
xbpcb Apr 19, 2024
1385fb0
Gp: mv iw creation to separate func, mod markers and iws upd logic
xbpcb Apr 19, 2024
380b06b
Gp: fix map markers and IWs create-update logic
xbpcb Apr 23, 2024
c4764b0
Gp: fix isue with timing calcs while infinite
xbpcb Apr 23, 2024
146565c
Gp: mod infinite amrkersData handling, mod consts usage
xbpcb Apr 24, 2024
7ccf376
GpResRaw: fix infinite avg timing
xbpcb Apr 24, 2024
0066abc
Fix typo
xbpcb Apr 24, 2024
00f7638
Gp: mod parseGpRawOutputForTimings
xbpcb Apr 24, 2024
8152fd7
Gp: mod infinite timings handling
xbpcb Apr 24, 2024
4da2f25
GpTableOutput: mod infinite timings handling
xbpcb Apr 24, 2024
b14df92
GpResRaw: mod infinite timings handling
xbpcb Apr 24, 2024
0f6bc2b
GpTable: fix timings when regular meas
xbpcb Apr 25, 2024
ebaca28
GpTable: rm redundanttooltip property
xbpcb Apr 25, 2024
27a91df
Tooltip: mod content handling
xbpcb Apr 25, 2024
ee5ca89
GpRaw: small fix
xbpcb Apr 25, 2024
37fb5e2
GpRaw: fix failed probe case for infinite
xbpcb Apr 25, 2024
5fd9661
GpTable: fix timings handling
xbpcb Apr 26, 2024
16188d7
GpRaw: fix timings handling
xbpcb Apr 26, 2024
4cd057d
Gp: mod comment, rename vars
xbpcb Apr 26, 2024
88fe27c
Gp: rename vars
xbpcb Apr 26, 2024
43feb18
Gp: rename vars
xbpcb Apr 26, 2024
4d0c89a
Gp: fix marker iw timing calcs for infinite
xbpcb Apr 26, 2024
b622dd5
Gp: linter fix
xbpcb Apr 26, 2024
847924e
Gp: mod comment
xbpcb Apr 26, 2024
c33c221
GpRaw: fix loss calcs for infinite flow
xbpcb Apr 29, 2024
94ab7cf
GpRaw: fix timing display when probe is failed
xbpcb Apr 29, 2024
798407b
GpResTable: fix paddings
xbpcb Apr 30, 2024
9086da4
GpResRaw: fix loss display when failed
xbpcb Apr 30, 2024
0d2f9f6
Gp: fix IW content when probe is failed
xbpcb Apr 30, 2024
42e1d0e
GpResTable: fix offline probe case for regular flow
xbpcb Apr 30, 2024
c43c8d1
GpResTable: rm redundant condition for timings
xbpcb Apr 30, 2024
8886eb2
GpResTable: use const for failed text
xbpcb Apr 30, 2024
f4bea45
GpResTable: rm redundant condition for skeleton while infinite meas a…
xbpcb May 1, 2024
0aa14f8
Gp: fix infinite test run btn text when no probes found
xbpcb May 1, 2024
6b50611
Gp: mod handling btn context on err
xbpcb May 1, 2024
9731390
Fix linter issues
xbpcb May 1, 2024
5217162
Gp: fix marker data timings handling while infinite
xbpcb May 2, 2024
78c2796
Gp: rm redundant props, mod timings displaying logic
xbpcb May 2, 2024
5421c9c
GpResRaw: mod timings logic
xbpcb May 2, 2024
8eb88c1
GpResTAble: fix timings separators
xbpcb May 2, 2024
9aee67f
GpResTable: temp fix for infinite while probe is offline
xbpcb May 2, 2024
89efb80
GpResTable: add todo
xbpcb May 2, 2024
bd2f1bd
GpResTable: fix total packet cnt while infinite
xbpcb May 2, 2024
ba7c137
Fix parseGpRawOutputForTimings total packets cnt
xbpcb May 3, 2024
066aca5
Gp: stop infinite measurement when probes failed
xbpcb May 3, 2024
dfba16c
Small fix
xbpcb May 3, 2024
45df88a
Gp: fix markers update
xbpcb May 6, 2024
104dc0f
Gp: mod marker creation
xbpcb May 6, 2024
bb03a14
GpResTable: rename res handling methods
xbpcb May 7, 2024
ce3406f
Gp, GpRaw, GpTable: use single results handling for regular measurement
xbpcb May 8, 2024
ef71196
Gp, GpRaw, GpTable: use single point infinite results handling
xbpcb May 8, 2024
6ec4f7c
Gp: mod comment
xbpcb May 9, 2024
e3e322a
GpResRaw: fix timings displaying
xbpcb May 9, 2024
643f6ff
Gp: fix infinite results timings prep
xbpcb May 9, 2024
926f450
Gp, GpRaw: fix extraValues handling
xbpcb May 9, 2024
230f59b
Gp: fix measurement
xbpcb May 9, 2024
051ad7e
GpResRaw: fix status line color logic
xbpcb May 9, 2024
b28d1a9
GpResRaw: fix failed probe timing displaying
xbpcb May 9, 2024
bf8b7be
Gp: fix rawOutput displaying when probe is failed
xbpcb May 9, 2024
c087677
Gp: mod raw-table switching
xbpcb May 9, 2024
2b3c35e
Gp: rm unused styles
xbpcb May 9, 2024
77e8baa
Merge branch 'master' into gh-592
xbpcb May 9, 2024
59213ee
GpTable: fix status line width
xbpcb May 10, 2024
aba3155
Gp: fix testType param prop
xbpcb May 10, 2024
dd8490d
Gp: rm redundant rawRes's prop
xbpcb May 10, 2024
e40fbb8
GpResRaw: fix displaying of timing
xbpcb May 10, 2024
370ae12
GpResTAble: fix graph displaying
xbpcb May 13, 2024
47a0d5b
Rm extra space
xbpcb May 14, 2024
dd98405
Gp: fix markers data handling while infinite
xbpcb May 14, 2024
7b80263
Merge branch 'master' into gh-592
xbpcb May 15, 2024
d3b9bfd
Add memoize func
xbpcb May 20, 2024
4df8ac9
Gp: use memoize for results preparations
xbpcb May 20, 2024
c9e3779
Linter fix
xbpcb May 20, 2024
f836b40
GpResTable: use memoize for graph creation
xbpcb May 20, 2024
0d52553
Gp: fix markers update
xbpcb May 22, 2024
14468c5
GpResRaw: fix displaying timings
xbpcb May 22, 2024
acc5892
GpResRaw: fix
xbpcb May 22, 2024
d054f3b
GpResRaw: another fix displaying timings
xbpcb May 22, 2024
d1f5468
Small fix
xbpcb May 22, 2024
61f9f74
GpRes raw, table: fix block height handling
xbpcb May 23, 2024
2d66a84
Gp: do not allow to switch test type while measurement
xbpcb May 23, 2024
afbb019
Gp: mod code
xbpcb May 23, 2024
73c2f39
Gp: disable meas opts while measurement
xbpcb May 23, 2024
35bc5ca
Gp: block location and limit inputs while meas
xbpcb May 23, 2024
950c165
TagsInput: add disabling logic
xbpcb May 23, 2024
6228bbc
Gp: disable target input while measurement
xbpcb May 23, 2024
a561f73
Esm: small fix, use styles var
xbpcb May 24, 2024
5f7cead
ControlledInput: use styles var
xbpcb May 24, 2024
f30c9fc
TagsInput: add disabled styles
xbpcb May 24, 2024
a4b2865
Gp: add additional opts disabled styles
xbpcb May 24, 2024
59d3a22
Linter fix
xbpcb May 24, 2024
717e59f
Gp: add disabled logic and styles
xbpcb May 24, 2024
61c427e
GpResCtrls: rename func
xbpcb May 24, 2024
0905907
Gp: fix output mode while not ping measurement
xbpcb May 24, 2024
68138aa
Gp: add disable logic and style for test type dropdown
xbpcb May 24, 2024
8fa6406
TagsInput: fix disabled styles, logic
xbpcb May 24, 2024
e7ba370
Gp: rm redundant memo func
xbpcb May 24, 2024
7b43b64
Gp: do not show additional opts counter while infinite meas
xbpcb May 28, 2024
7c92912
TagsInput: add default value logic
xbpcb May 29, 2024
23723c3
Gp: add default value for target input
xbpcb May 29, 2024
94b3390
TagsInput: mod enter key logic
xbpcb May 29, 2024
9edf572
Gp: fix run test btn logic, styles
xbpcb May 30, 2024
c688b90
Gp: fix dropdown styles
xbpcb May 30, 2024
9bc9706
Gp: fix dropDown handler
xbpcb May 30, 2024
ca1467e
Small fix
xbpcb May 30, 2024
a626ad5
GpResTable: fix styles
xbpcb May 31, 2024
0684a4c
GpResTable: mod timings displaying
xbpcb May 31, 2024
3e5a766
GpResTable: format timings values, fix units displaying
xbpcb May 31, 2024
011f2bd
GpResTable: mod styles
xbpcb May 31, 2024
a136b85
Linter fix
xbpcb May 31, 2024
c730eeb
TagsInput: fix input styles when disabled
xbpcb May 31, 2024
287ca6f
Gp: fix infinite switch styles
xbpcb May 31, 2024
cd3b4d2
Linter fix
xbpcb May 31, 2024
e6cad2d
GpResTable: fix header's rtt column styles
xbpcb May 31, 2024
e32bb87
Fixed numbers format
MartinKolarik Jun 1, 2024
a642018
TagsInput: mode code, hide default tag on focus
xbpcb Jun 3, 2024
72f304d
GpResCtrls: mode active bar logic, styles
xbpcb Jun 3, 2024
e59dcdf
Gp: fix markers data mutation issue
xbpcb Jun 4, 2024
71171bf
Gp: fix infinite results handling mutation
xbpcb Jun 4, 2024
9fbb24c
GpResTable: fix quality column width
xbpcb Jun 4, 2024
7ef3356
Gp, GpResShare: mod share link creation
xbpcb Jun 5, 2024
868cad0
TagsInput, Gp: share res case deault value for input
xbpcb Jun 6, 2024
a245c8d
Gp, GpResShare: mod share link handling
xbpcb Jun 6, 2024
98d706a
Gp, GpResRaw: pass is infinite meas results prop
xbpcb Jun 7, 2024
7bb8120
GpResShare: seaprate regular measurements by comma, infinite one by plus
xbpcb Jun 7, 2024
55a095a
GpResShare: show cli cmd as not supported for multiple targets
xbpcb Jun 7, 2024
aa95c31
Gp, GpResShare: replace ids delimiter for infinite meas link
xbpcb Jun 7, 2024
6231298
Merge branch 'gh-592' of https://github.com/jsdelivr/www.jsdelivr.com…
xbpcb Jun 7, 2024
de3b7a5
GpResShare: fix cli cmd creation
xbpcb Jun 10, 2024
d61a177
Gp: fix infinite meas share res flow
xbpcb Jun 10, 2024
5eca04c
GpResShare: use last 10 ids for infintite meas link
xbpcb Jun 11, 2024
4411032
GpResShare: create msg fro long-running infinite meas
xbpcb Jun 11, 2024
5382828
GpResShare: mod logic, show msg for long-running infinite meas, fix s…
xbpcb Jun 11, 2024
c6a1469
Improve tags input tab handling
MartinKolarik Jun 12, 2024
d5d5c6d
Merge branch 'gh-592' of https://github.com/jsdelivr/www.jsdelivr.com…
xbpcb Jun 12, 2024
fbe58ec
Switch to the new docker registry
MartinKolarik Jun 12, 2024
035812e
Merge branch 'gh-592' of https://github.com/jsdelivr/www.jsdelivr.com…
xbpcb Jun 12, 2024
d53d69e
GpResTable: fix styles
xbpcb Jun 13, 2024
f69c5ec
GpResShare, GpResTable: fix styles
xbpcb Jun 13, 2024
1012bda
GpResTAble: fix padding
xbpcb Jun 13, 2024
44cabf1
GpResShare: fix msg styles
xbpcb Jun 13, 2024
c047fb1
Gp: switch to table when sharing infinite meas
xbpcb Jun 13, 2024
7671bb6
Gp,GpResShare: use dot as delimiter for infinite share link
xbpcb Jun 13, 2024
aab65ea
Gp: mod prepareInfiniteResults
xbpcb Jun 14, 2024
f41f308
Gp: small fixes
xbpcb Jun 14, 2024
7414b54
Merge branch 'gh-592-rewrite-infinite' into gh-592
xbpcb Jun 14, 2024
4bcbab8
Gp: fix infinite ip addr
xbpcb Jun 14, 2024
ccc273e
Gp: set limit to 5 for infinite measurement
xbpcb Jun 14, 2024
438417e
Merge branch 'master' into gh-592
MartinKolarik Jun 15, 2024
f1f7927
Gp: mod limit logic while infinite meas
xbpcb Jun 18, 2024
8f73217
Gp: dont disable limit input while infinite meas, just reduce its value
xbpcb Jun 18, 2024
e322321
ControlledInput: hide-show icon on condition
xbpcb Jun 18, 2024
94a367b
Gp: add limit input icon for infinite case
xbpcb Jun 18, 2024
f47d159
NetworkTools: fix ctrls styles
xbpcb Jun 18, 2024
ec5c106
Tooltip: add rawHtml logic
xbpcb Jun 18, 2024
86d5555
Tooltip: rawHtml styles
xbpcb Jun 18, 2024
025c46a
GpResTable: add rawHtml attr to Tooltip
xbpcb Jun 18, 2024
a8dfb27
GpResTable: fix border styles
xbpcb Jun 18, 2024
f6f7013
GpResCtrls: show tabs
xbpcb Jun 18, 2024
0c37077
TagsInput: fix styles
xbpcb Jun 18, 2024
243f99f
Gp: do not pass input icon to tagsInput
xbpcb Jun 18, 2024
480d61e
Gp: show label icon with tooltip for target input
xbpcb Jun 18, 2024
f78f1cf
TagsInput: fix paddings
xbpcb Jun 18, 2024
6e7c311
TagsInput: fix styles
xbpcb Jun 19, 2024
e049e6f
Update globalping.html
MartinKolarik Jun 19, 2024
eea5d29
Update globalping.html
MartinKolarik Jun 19, 2024
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
12 changes: 12 additions & 0 deletions src/assets/img/globalping/map-icon.active.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions src/assets/img/globalping/map-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions src/assets/img/globalping/raw-output-icon.active.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions src/assets/img/globalping/raw-output-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/img/globalping/table-output-icon.active.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/img/globalping/table-output-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/assets/img/globalping/tag-input-close-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions src/assets/img/globalping/target-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
86 changes: 78 additions & 8 deletions src/assets/js/_.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ module.exports = {
url,
headers,
responseHeadersToGet = null,
onFailReturnStatus = false,
// onFailReturnStatus = false,
} = obj;

return new Promise((resolve, reject) => {
Expand Down Expand Up @@ -426,11 +426,11 @@ module.exports = {
resolve(response);
}
} else {
if (onFailReturnStatus) {
reject(new Error(xhr.status));
} else {
reject(response);
}
// eslint-disable-next-line prefer-promise-reject-errors
reject({
...response,
responseStatusCode: xhr.status,
});
}
};

Expand Down Expand Up @@ -1216,10 +1216,23 @@ module.exports = {
return `${text.substr(0, length - 3)}...`;
},

getGpProbeLastTiming (testType, result) {
let lastTiming;
let { timings = [] } = result;

if (testType === 'ping') {
lastTiming = timings[timings.length - 1] ? timings[timings.length - 1].rtt : PROBE_NO_TIMING_VALUE;
}

return lastTiming;
},

calcGpTestResTiming (testType, testResData, dnsTraceEnabled = false, units = ' ms') {
let resTiming;
let lastTiming;
let extraValues = {};
let lowCaseTestName = testType.toLowerCase();
lastTiming = this.getGpProbeLastTiming(testType, testResData.result);

if (testResData.result?.status === PROBE_STATUS_FAILED) {
return {
Expand All @@ -1233,7 +1246,7 @@ module.exports = {
value: PROBE_STATUS_OFFLINE,
extraValues,
fullText: PROBE_STATUS_OFFLINE,
isFailed: true,
isFailed: false,
};
}

Expand Down Expand Up @@ -1348,14 +1361,16 @@ module.exports = {
units,
note,
fullText: note ? `${Math.round(resTiming)}${units} ${note}` : `${Math.round(resTiming)}${units}`,
lastTiming,
};
}

return {
value: PROBE_NO_TIMING_VALUE,
extraValues,
fullText: PROBE_NO_TIMING_VALUE,
isFailed: true,
isFailed: testResData.result?.status === PROBE_STATUS_FAILED,
lastTiming: PROBE_NO_TIMING_VALUE,
};
},

Expand Down Expand Up @@ -1396,4 +1411,59 @@ module.exports = {
left: box.left + window.scrollX - docElem.clientLeft,
};
},

removeDuplicatedTargets (arr) {
return arr.reduce((uniquesArr, item) => {
if (uniquesArr.indexOf(item) < 0) {
uniquesArr.push(item);
}

return uniquesArr;
}, []);
},

parseGpRawOutputForTimings (raw) {
let packetsRtt = [];
let packetsDrop = 0;
let timeMatch;
let timeRegex = /time=(\d+(\.\d+)?)/;
let lines = raw.split('\n').filter(l => l);
let currPacketRtt;

for (let i = 0; i < lines.length; i++) {
if (i === 0) { continue; }

if (lines[i].includes('---')) { break; }

timeMatch = timeRegex.exec(lines[i]);

if (timeMatch === null) {
packetsDrop++;
currPacketRtt = PROBE_NO_TIMING_VALUE;
} else {
currPacketRtt = parseFloat(timeMatch[1]);
}

packetsRtt.push(currPacketRtt);
}

return {
packetsRtt,
packetsDrop,
packetsTotal: packetsRtt.length,
};
},
memoize (func) {
let cache = new Map();

return function (...args) {
let key = JSON.stringify(args);

if (!cache.has(key)) {
cache.set(key, func.apply(this, args));
}

return cache.get(key);
};
},
};
12 changes: 11 additions & 1 deletion src/assets/js/decorators/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ let tooltipDecorator = (
node,
content,
position = 'top',
rawHtml = false,
elementName = 'div',
className,
offsetX,
Expand Down Expand Up @@ -69,7 +70,16 @@ let tooltipDecorator = (
if (document.querySelector('#ractive-tooltip-instance') === null) {
tooltip = document.createElement(elementName);
tooltip.className = `ractive-tooltip ${getPositionClass(position)}${className ? ` ${className}` : ''}`;
tooltip.textContent = content;

if (rawHtml) {
let preTag = document.createElement('pre');

preTag.textContent = content;
tooltip.appendChild(preTag);
} else {
tooltip.textContent = content;
}

tooltip.id = 'ractive-tooltip-instance';
document.body.appendChild(tooltip);
}
Expand Down
2 changes: 1 addition & 1 deletion src/assets/js/utils/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ module.exports.postGlobalpingMeasurement = (opts) => {
};

module.exports.getGlobalpingMeasurement = (id) => {
return _.makeHTTPRequest({ url: `${GLOBALPING_HOST}/v1/measurements/${id}`, onFailReturnStatus: true });
return _.makeHTTPRequest({ url: `${GLOBALPING_HOST}/v1/measurements/${id}` });
};


Expand Down
7 changes: 6 additions & 1 deletion src/assets/less/app-globalping.less
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@
@import "common-globalping.less";

@import "components/controlled-input.less";
@import "components/gp-test-results.less";
@import "components/gp-top-navigation.less";
@import "components/gp-jumbotron.less";
@import "components/gp-test-depiction.less";
@import "components/tags-input.less";
@import "components/gp-results-controls.less";
@import "components/gp-results-raw-output.less";
@import "components/gp-results-table-output.less";
@import "components/gp-results-share.less";
@import "components/gp-credits-message.less";

@import "pages/globalping.less";
@import "pages/globalping/cli.less";
Expand Down
Loading
Loading