@@ -97,21 +97,35 @@ const app = Vue.createApp({
9797 //this.search = this.search.slice(0,-1);
9898 //return;
9999 } else {
100- $ ( '#text_search' ) . css ( 'color' , 'initial' ) ;
101- if ( this . settings . filters ) {
102- this . saveFilters ( ) ;
100+ if ( this . search_by !== "log_lines" ) {
101+ $ ( '#text_search' ) . css ( 'color' , 'initial' ) ;
102+ if ( this . settings . filters ) {
103+ this . saveFilters ( ) ;
104+ } else {
105+ $ ( '#default_period_div' ) . show ( ) ;
106+ }
107+ this . search_error = false ;
108+ this . reset_page ( ) ;
109+
110+ } else {
111+ this . setDuration_Log_lines ( ) ;
103112 }
104- this . search_error = false ;
105- this . reset_page ( ) ;
106113 this . debounce_emails ( true ) ;
107114 }
108115 } ,
109116 search_by ( val ) {
110117 if ( this . search !== "" ) {
111- if ( this . settings . filters ) {
112- this . saveFilters ( ) ;
118+ if ( this . search_by !== "log_lines" ) {
119+ if ( this . settings . filters ) {
120+ this . saveFilters ( ) ;
121+ } else {
122+ $ ( '#default_period_div' ) . show ( ) ;
123+ }
124+ this . reset_page ( ) ;
125+
126+ } else {
127+ this . setDuration_Log_lines ( ) ;
113128 }
114- this . reset_page ( ) ;
115129 this . debounce_emails ( true ) ;
116130 }
117131 } ,
@@ -123,10 +137,15 @@ const app = Vue.createApp({
123137 this . debounce_emails ( true ) ;
124138 } ,
125139 date_filter__gt ( val ) {
126- if ( this . settings . filters ) {
127- this . saveFilters ( ) ;
140+ if ( this . search_by !== "log_lines" ) {
141+ if ( this . settings . filters ) {
142+ this . saveFilters ( ) ;
143+ }
144+ this . reset_page ( ) ;
145+
146+ } else {
147+ this . setDuration_Log_lines ( ) ;
128148 }
129- this . reset_page ( ) ;
130149 // do not debounce on datestart change ???
131150 this . debounce_emails ( true ) ;
132151 } ,
@@ -380,20 +399,34 @@ const app = Vue.createApp({
380399 this . loading = false ;
381400 }
382401 } ,
383- check_nothing_found ( count , table ) {
402+ check_nothing_found ( count , table , wait ) {
384403 // if no results don't show table and show notification
385404 if ( count == 0 ) {
386- if ( this . localeData . notie . nine == undefined ) {
387- text = this . fallbackLocaleData . notie . nine
388- } else {
389- text = this . localeData . notie . nine
390- }
391- notie . alert ( { type : 'info' , text : text } ) ;
405+ // make delay for notie only, not hide operations
406+ setTimeout ( ( ) => {
407+ if ( this . localeData . notie . nine == undefined ) {
408+ text = this . fallbackLocaleData . notie . nine
409+ } else {
410+ text = this . localeData . notie . nine
411+ }
412+ notie . alert ( { type : 'info' , text : text } ) ;
413+ } , wait ) ;
392414 table . hide ( ) ;
393415 $ ( '.JCLRgrips' ) . hide ( ) ;
394416 }
395417 } ,
396418 loadEmails ( refresh ) {
419+ var wait = 0 ;
420+ // show
421+ if ( this . search_by == "log_lines" ) {
422+ wait = 3000 ;
423+ if ( this . localeData . notie . three == undefined ) {
424+ text = this . fallbackLocaleData . notie . ten
425+ } else {
426+ text = this . localeData . notie . ten
427+ }
428+ notie . alert ( { type : 'warning' , text : text } ) ;
429+ }
397430 // check if search_error clear search text
398431 if ( this . search_error ) {
399432 this . search = "" ;
@@ -445,7 +478,7 @@ const app = Vue.createApp({
445478 $found_table = $ ( '.emails-list' ) ;
446479 thead = $found_table . find ( 'thead' ) ;
447480 // if no results don't show table and show notification
448- this . check_nothing_found ( this . count , $found_table ) ;
481+ this . check_nothing_found ( this . count , $found_table , wait ) ;
449482
450483 if ( refresh ) {
451484 // scroll to the table top
@@ -620,7 +653,7 @@ const app = Vue.createApp({
620653 this . $nextTick ( function ( ) {
621654 // check if we are on login or api_error screen
622655 if ( ! ( ( $ ( "div.logo.login" ) . length > 0 ) || ( $ ( ".api_error_container" ) . length > 0 ) ) ) {
623- this . check_nothing_found ( 0 , $ ( '.emails-list' ) ) ;
656+ this . check_nothing_found ( 0 , $ ( '.emails-list' ) , 0 ) ;
624657 }
625658 } ) ;
626659 } ) ;
@@ -750,6 +783,18 @@ const app = Vue.createApp({
750783 saveCurPage ( ) {
751784 window . localStorage [ 'cur_page' ] = this . page ;
752785 } ,
786+ setDuration_Log_lines ( ) {
787+ //console.log("Force heavy load search to the last 24 hours!");
788+ $ ( '#default_period_div' ) . hide ( ) ;
789+ var startdate = new Date ( new Date ( Date . now ( ) ) - 24 * 60 * 60000 /* - tzoffset*/ ) ;
790+ startdate = this . format_date ( startdate , datetime_format , true ) ;
791+ this . date_filter__gt = startdate ;
792+ this . date_filter__lt = "" ;
793+ this . saveFilters ( ) ;
794+ //this.debounce_emails(true);
795+ //this.reset_page();
796+
797+ } ,
753798 setDuration ( ) {
754799 this . $nextTick ( function ( ) {
755800 if ( ! ( this . settings . filters ) ) {
@@ -766,12 +811,14 @@ const app = Vue.createApp({
766811 // autorefresh
767812 this . $nextTick ( function ( ) {
768813 clearInterval ( window . app . timer ) ;
769- window . app . timer = setInterval ( function ( ) {
770- if ( window . app . settings . refresh !== undefined ) {
771- //console.log("Page is refreshed after " + window.app.settings.refresh + " seconds passed.");
772- window . app . loadEmails ( false ) ;
773- }
774- } , window . app . settings . refresh * 60000 ) ;
814+ if ( window . app . settings . refresh > 0 ) {
815+ window . app . timer = setInterval ( function ( ) {
816+ if ( window . app . settings . refresh !== undefined ) {
817+ //console.log("Page is refreshed after " + window.app.settings.refresh + " seconds passed.");
818+ window . app . loadEmails ( false ) ;
819+ }
820+ } , window . app . settings . refresh * 60000 ) ;
821+ }
775822 } ) ;
776823 } ,
777824 loadCurPage ( ) {
0 commit comments