Skip to content

Commit

Permalink
started working on demo mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Mar 15, 2020
1 parent 0a60cf7 commit 8f9af1c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/store/modules/activity_daily.ts
Expand Up @@ -111,6 +111,15 @@ const actions = {
}
},

async load_demo({ commit }) {
// A function to load some demo data (for screenshots and stuff)
commit('query_window_completed', {
app_events: [{ duration: 10, data: { app: 'test' } }],
});
commit('query_browser_completed', {});
commit('query_editor_completed', {});
},

async query_window({ commit }, { host, timeperiod, filterAFK, filterCategories }: QueryOptions) {
const start = moment();
const periods = [timeperiodToStr(timeperiod)];
Expand Down
8 changes: 8 additions & 0 deletions src/views/activity/daily/ActivityDaily.vue
Expand Up @@ -60,6 +60,10 @@ div
div.col-md-6
b-form-group(label="Show category" label-cols="5" label-cols-lg="4")
b-form-select(v-model="filterCategory", :options="categories")

aw-devonly
b-btn(@click="load_demo")
| Load demo data
</template>

<style lang="scss" scoped>
Expand Down Expand Up @@ -188,6 +192,10 @@ export default {
refresh: async function(force) {
await this.$store.dispatch("activity_daily/ensure_loaded", { timeperiod: this.timeperiod, host: this.host, force: force, filterAFK: true, filterCategories: this.filterCategories });
},
load_demo: async function() {
await this.$store.dispatch('activity_daily/load_demo');
},
},
}
</script>

0 comments on commit 8f9af1c

Please sign in to comment.