@@ -8,6 +8,7 @@ var ISPConfig = {
88 indicatorCompleted : false ,
99 registeredHooks : new Array ( ) ,
1010 new_tpl_add_id : 0 ,
11+ dataLogTimer : 0 ,
1112
1213 options : {
1314 useLoadIndicator : false ,
@@ -175,6 +176,8 @@ var ISPConfig = {
175176 ISPConfig . onAfterContentLoad ( target , $ ( '#' + formname ) . serialize ( ) ) ;
176177 ISPConfig . pageFormChanged = false ;
177178 }
179+ clearTimeout ( dataLogTimer ) ;
180+ ISPConfig . dataLogNotification ( ) ;
178181 ISPConfig . hideLoadIndicator ( ) ;
179182 } ,
180183 error : function ( jqXHR , textStatus , errorThrown ) {
@@ -282,6 +285,8 @@ var ISPConfig = {
282285 ISPConfig . onAfterContentLoad ( pagename , ( params ? params : null ) ) ;
283286 ISPConfig . pageFormChanged = false ;
284287 }
288+ clearTimeout ( dataLogTimer ) ; // clear running dataLogTimer
289+ ISPConfig . dataLogNotification ( ) ;
285290 ISPConfig . hideLoadIndicator ( ) ;
286291 } ,
287292 error : function ( ) {
@@ -346,7 +351,7 @@ var ISPConfig = {
346351
347352 ISPConfig . loadMenus ( ) ;
348353 ISPConfig . keepalive ( ) ;
349- ISPConfig . datalognotification ( ) ;
354+ ISPConfig . dataLogNotification ( ) ;
350355 setTimeout ( function ( ) {
351356 try {
352357 $ ( 'form#pageForm' ) . find ( 'input[name="username"]' ) . focus ( ) ;
@@ -494,25 +499,27 @@ var ISPConfig = {
494499 }
495500 } ) ;
496501 } ,
497- datalognotification : function ( ) {
502+ dataLogNotification : function ( ) {
503+ console . log ( ISPConfig . options ) ;
498504 var notificationContent = $ . ajax ( {
499505 type : "GET" ,
500506 url : "datalogstatus.php" ,
501507 dataType : "json" ,
502508 success : function ( data , textStatus , jqXHR ) {
503509 var dataLogItems = [ ] ;
504510 $ . each ( data [ 'entries' ] , function ( key , val ) {
505- dataLogItems . push ( '<li><strong>' + val [ 'text' ] + ':</strong> ' + val [ 'count' ] + '</li>' ) ;
511+ dataLogItems . push ( '<li><strong>' + val [ 'text' ] + ':</strong> ' + val [ 'count' ] + '</li>' ) ;
506512 } ) ;
507513 if ( data [ 'count' ] > 0 ) {
508514 $ ( '.modal-body' ) . html ( dataLogItems . join ( "" ) ) ;
509515 $ ( '.notification_text' ) . text ( data [ 'count' ] ) ;
510516 $ ( '.notification' ) . css ( 'display' , '' ) ;
511- setTimeout ( function ( ) { ISPConfig . datalognotification ( ) ; } , 2000 ) ;
517+ dataLogTimer = setTimeout ( function ( ) { ISPConfig . dataLogNotification ( ) ; } , 2000 ) ;
512518 } else {
513519 $ ( '.notification' ) . css ( 'display' , 'none' ) ;
514520 $ ( '.modal-body' ) . html ( '' ) ;
515- setTimeout ( function ( ) { ISPConfig . datalognotification ( ) ; } , 5000 ) ;
521+ $ ( '#datalogModal' ) . modal ( 'hide' ) ;
522+ dataLogTimer = setTimeout ( function ( ) { ISPConfig . dataLogNotification ( ) ; } , 5000 ) ;
516523 }
517524 } ,
518525 error : function ( ) {
0 commit comments