Skip to content

Commit 107ae4d

Browse files
committed
feat: added active history data to demomode, removed excessive logging
1 parent ed6bed6 commit 107ae4d

2 files changed

Lines changed: 20 additions & 4 deletions

File tree

src/store/modules/activity_daily.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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) {

src/views/activity/daily/ActivityDaily.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ export default {
134134
},
135135
categories: function() {
136136
const cats = this.$store.getters['settings/all_categories'];
137-
console.log(cats);
138137
const entries = cats.map(c => {
139138
return { text: c.join(' > '), value: c };
140139
});
@@ -149,7 +148,6 @@ export default {
149148
const cats = this.$store.getters['settings/all_categories'];
150149
const isChild = p => c => c.length > p.length && _.isEqual(p, c.slice(0, p.length));
151150
const children = _.filter(cats, isChild(this.filterCategory));
152-
console.log(children);
153151
return [this.filterCategory].concat(children);
154152
} else {
155153
return null;

0 commit comments

Comments
 (0)