Skip to content

Commit 8f9af1c

Browse files
committed
started working on demo mode
1 parent 0a60cf7 commit 8f9af1c

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/store/modules/activity_daily.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,15 @@ const actions = {
111111
}
112112
},
113113

114+
async load_demo({ commit }) {
115+
// A function to load some demo data (for screenshots and stuff)
116+
commit('query_window_completed', {
117+
app_events: [{ duration: 10, data: { app: 'test' } }],
118+
});
119+
commit('query_browser_completed', {});
120+
commit('query_editor_completed', {});
121+
},
122+
114123
async query_window({ commit }, { host, timeperiod, filterAFK, filterCategories }: QueryOptions) {
115124
const start = moment();
116125
const periods = [timeperiodToStr(timeperiod)];

src/views/activity/daily/ActivityDaily.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ div
6060
div.col-md-6
6161
b-form-group(label="Show category" label-cols="5" label-cols-lg="4")
6262
b-form-select(v-model="filterCategory", :options="categories")
63+
64+
aw-devonly
65+
b-btn(@click="load_demo")
66+
| Load demo data
6367
</template>
6468

6569
<style lang="scss" scoped>
@@ -188,6 +192,10 @@ export default {
188192
refresh: async function(force) {
189193
await this.$store.dispatch("activity_daily/ensure_loaded", { timeperiod: this.timeperiod, host: this.host, force: force, filterAFK: true, filterCategories: this.filterCategories });
190194
},
195+
196+
load_demo: async function() {
197+
await this.$store.dispatch('activity_daily/load_demo');
198+
},
191199
},
192200
}
193201
</script>

0 commit comments

Comments
 (0)