File tree 3 files changed +23
-18
lines changed
3 files changed +23
-18
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ const tick = new Timer(
50
50
function apiMonitorPostMetric ( ) {
51
51
meanExecutionTime . add ( tick . executionTime ) ;
52
52
// adaptive update-frequency
53
- if ( tick . executionTime < 3 ) {
53
+ if ( 0 < tick . executionTime && tick . executionTime < 3 ) {
54
54
tick . options . animation = true ;
55
55
} else {
56
56
tick . options . animation = false ;
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import type { TPanelVisibilityMap } from '@/api/settings.ts';
16
16
import { sha256 } from 'js-sha256' ;
17
17
18
18
export type TCallstack = {
19
- name : string ;
19
+ name : string | 0 ;
20
20
link : string ;
21
21
} [ ] ;
22
22
export enum ETimeType {
@@ -78,17 +78,25 @@ function createCallstack(e: Error): TCallstack {
78
78
// loop from the end, excluding error name and self trace
79
79
for ( let n = arr . length - 1 ; n > 1 ; n -- ) {
80
80
let v = arr [ n ] ;
81
+
82
+ if ( v . indexOf ( selfCallLink ) >= 0 ) {
83
+ continue ;
84
+ }
85
+
81
86
v = v . replace ( REGEX_STACKTRACE_PREFIX , '' ) ;
82
87
const link = v . replace ( REGEX_STACKTRACE_LINK , '$1' ) . trim ( ) ;
83
88
84
- if ( link . indexOf ( selfCallLink ) >= 0 ) {
89
+ if ( link . startsWith ( '<anonymous>' ) ) {
85
90
continue ;
86
91
}
87
92
88
- rv . push ( {
89
- name : v . replace ( REGEX_STACKTRACE_NAME , '$1' ) . trim ( ) ,
90
- link,
91
- } ) ;
93
+ let name : string | 0 = v . replace ( REGEX_STACKTRACE_NAME , '$1' ) . trim ( ) ;
94
+
95
+ if ( name === link ) {
96
+ name = 0 ;
97
+ }
98
+
99
+ rv . push ( { name, link } ) ;
92
100
}
93
101
94
102
if ( ! rv . length ) {
Original file line number Diff line number Diff line change 7
7
} from ' @/api/const.ts' ;
8
8
9
9
export let href: string = ' ' ;
10
- export let name: string = ' ' ;
11
- let beenClicked = false ;
10
+ export let name: string | 0 = 0 ;
11
+ let isSeen = false ;
12
12
13
13
$ : lineNumber = parseInt (
14
14
href ?.replace (REGEX_STACKTRACE_LINE_NUMBER , ' $1' ),
18
18
href .replace (REGEX_STACKTRACE_COLUMN_NUMBER , ' $1' ),
19
19
10
20
20
);
21
- $ : isSourceLess =
22
- ! isFinite (lineNumber ) ||
23
- href .startsWith (' <anonymous>' ) ||
24
- TAG_INVALID_CALLSTACK === href ;
21
+ $ : isSourceLess = ! isFinite (lineNumber ) || TAG_INVALID_CALLSTACK === href ;
25
22
26
23
function showStackTraceResource(e : MouseEvent ) {
27
24
e .preventDefault ();
34
31
columnNumber - 1
35
32
);
36
33
37
- beenClicked = true ;
34
+ isSeen = true ;
38
35
}
39
36
</script >
40
37
41
38
{#if isSourceLess }
42
- <i class ="no-link" >{` ${name } ${ href === name ? ' ' : href } ` }</i >
39
+ <i class ="no-link" >{` ${name ? name : ' ' } ${ href } ` }</i >
43
40
{:else }
44
41
<a
45
42
{href }
46
43
title ={` ${lineNumber }:${columnNumber } ` }
47
- class:beenClicked
48
- on:click ={showStackTraceResource }>{name }</a
44
+ class:isSeen
45
+ on:click ={showStackTraceResource }>{name || href }</a
49
46
>
50
47
{/if }
51
48
64
61
text-overflow : ellipsis ;
65
62
max-width : 25rem ;
66
63
67
- & .beenClicked {
64
+ & .isSeen {
68
65
color : var (--link-visited-text );
69
66
background-color : var (--link-visited-bg );
70
67
}
You can’t perform that action at this time.
0 commit comments