@@ -166,7 +166,6 @@ const actions = {
166166 const periods = timeperiodStrsAroundTimeperiod ( timeperiod ) . filter ( tp_str => {
167167 return ! _ . includes ( state . active_history , tp_str ) ;
168168 } ) ;
169- console . log ( periods ) ;
170169 const bucket_id_afk = 'aw-watcher-afk_' + host ;
171170 const queryStart = moment ( ) ;
172171 const data = await this . _vm . $aw . query ( periods , queries . dailyActivityQuery ( bucket_id_afk ) ) ;
@@ -330,6 +329,24 @@ const actions = {
330329 languages : [ { duration : 10 , data : { language : 'python' } } ] ,
331330 projects : [ { duration : 10 , data : { project : 'aw-core' } } ] ,
332331 } ) ;
332+
333+ function build_active_history ( ) {
334+ const active_history = { } ;
335+ let current_day = moment ( get_day_start_with_offset ( ) ) ;
336+ _ . map ( _ . range ( 0 , 30 ) , ( ) => {
337+ const current_day_end = moment ( current_day ) . add ( 1 , 'day' ) ;
338+ active_history [ `${ current_day . format ( ) } /${ current_day_end . format ( ) } ` ] = [
339+ {
340+ timestamp : current_day . format ( ) ,
341+ duration : 100 + 900 * Math . random ( ) ,
342+ data : { status : 'not-afk' } ,
343+ } ,
344+ ] ;
345+ current_day = current_day . add ( - 1 , 'day' ) ;
346+ } ) ;
347+ return active_history ;
348+ }
349+ commit ( 'query_active_history_completed' , { active_history : build_active_history ( ) } ) ;
333350 } ,
334351} ;
335352
@@ -355,6 +372,8 @@ const mutations = {
355372 state . top_categories = null ;
356373 state . active_duration = null ;
357374 state . active_events = null ;
375+
376+ state . active_history = { } ;
358377 } ,
359378
360379 query_window_completed ( state , data ) {
@@ -364,7 +383,6 @@ const mutations = {
364383 state . active_duration = data [ 'duration' ] ;
365384 state . app_chunks = data [ 'app_chunks' ] ;
366385 state . active_events = data [ 'active_events' ] ;
367- console . log ( state . active_events ) ;
368386 } ,
369387
370388 query_browser_completed ( state , data ) {
0 commit comments