Skip to content

Commit 0121741

Browse files
committed
CBDEBUGGER-16 #resolve
Left double hash on no state for request tracker profiler CBDEBUGGER-15 #resolve Auto-Refresh is not working in latest version CBDEBUGGER-6 #resolve Stop auto-refresh when visiting a actual request report
1 parent 8baa9bb commit 0121741

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

resources/assets/js/components/RequestTrackerPanel.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export default ( isExpanded, refreshFrequency, hasReinitPassword, isVisualizer )
55
usingReinitPassword : hasReinitPassword,
66
isVisualizer : isVisualizer,
77
currentProfileId : "",
8+
refreshMonitor : null,
89

910
reinitFramework(){
1011
this.$refs.reinitLoader.classList.add( "cbd-spinner" );
@@ -21,6 +22,7 @@ export default ( isExpanded, refreshFrequency, hasReinitPassword, isVisualizer )
2122
} );
2223
},
2324
loadProfilerReport( id ){
25+
this.stopDebuggerMonitor();
2426
fetch( `${this.appUrl}cbDebugger/renderProfilerReport`, {
2527
method : "POST",
2628
headers : { "x-Requested-With": "XMLHttpRequest" },
@@ -31,13 +33,13 @@ export default ( isExpanded, refreshFrequency, hasReinitPassword, isVisualizer )
3133
} )
3234
.then( response => response.text() )
3335
.then( html => {
34-
history.pushState( { profileId: id }, null, "##" + id );
36+
history.pushState( { profileId: id }, null, "#" + id );
3537
this.$refs[ "cbd-profilers" ].innerHTML = html;
3638
coldboxDebugger.scrollTo( "cbd-request-tracker" );
3739
} );
3840
},
3941
clearState(){
40-
history.pushState( {}, null, "##" );
42+
history.pushState( {}, null, "#" );
4143
this.currentProfileId = "";
4244
},
4345
refreshProfilers(){
@@ -65,17 +67,18 @@ export default ( isExpanded, refreshFrequency, hasReinitPassword, isVisualizer )
6567
} );
6668
},
6769
stopDebuggerMonitor(){
68-
if ( "cbdRefreshMonitor" in window ){
69-
clearInterval( window.cbdRefreshMonitor );
70-
console.log( "Stopped ColdBox Debugger Profiler Refresh" );
70+
if ( "refreshMonitor" in this ){
71+
clearInterval( this.refreshMonitor );
72+
this.refreshFrequency = 0;
73+
console.info( "Stopped ColdBox Debugger Profiler Refresh" );
7174
}
7275
},
7376
startDebuggerMonitor( frequency ){
7477
if ( frequency == 0 ){
7578
return this.stopDebuggerMonitor();
7679
}
77-
window.cbdRefreshMonitor = setInterval( this.refreshProfilers, frequency * 1000 );
78-
console.log( "Started ColdBox Debugger Profiler Refresh using " + frequency + " seconds" );
80+
this.refreshMonitor = setInterval( () => this.refreshProfilers(), frequency * 1000 );
81+
console.info( "Started ColdBox Debugger Profiler Refresh using " + frequency + " seconds" );
7982
},
8083
init(){
8184
window.addEventListener( "popstate", e => {

0 commit comments

Comments
 (0)