Skip to content

Commit bc4e950

Browse files
refactor: Rename ActivityDaily to just Activity
1 parent c366500 commit bc4e950

File tree

10 files changed

+59
-61
lines changed

10 files changed

+59
-61
lines changed

src/components/SelectableVisualization.vue

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ div
2222
:colorfunc="e => e.data.$domain",
2323
with_limit)
2424
div(v-if="type == 'top_editor_files'")
25-
aw-summary(:fields="$store.state.activity_daily.editor.top_files",
25+
aw-summary(:fields="$store.state.activity.editor.top_files",
2626
:namefunc="top_editor_files_namefunc",
2727
:colorfunc="e => e.data.language",
2828
with_limit)
2929
div(v-if="type == 'top_editor_languages'")
30-
aw-summary(:fields="$store.state.activity_daily.editor.top_languages",
30+
aw-summary(:fields="$store.state.activity.editor.top_languages",
3131
:namefunc="e => e.data.language",
3232
:colorfunc="e => e.data.language",
3333
with_limit)
3434
div(v-if="type == 'top_editor_projects'")
35-
aw-summary(:fields="$store.state.activity_daily.editor.top_projects",
35+
aw-summary(:fields="$store.state.activity.editor.top_projects",
3636
:namefunc="top_editor_projects_namefunc",
3737
:colorfunc="e => e.data.language",
3838
with_limit)
@@ -110,19 +110,19 @@ export default {
110110
},
111111
computed: {
112112
top_apps: function() {
113-
return this.$store.state.activity_daily.window.top_apps;
113+
return this.$store.state.activity.window.top_apps;
114114
},
115115
top_titles: function() {
116-
return this.$store.state.activity_daily.window.top_titles;
116+
return this.$store.state.activity.window.top_titles;
117117
},
118118
top_domains: function() {
119-
return this.$store.state.activity_daily.browser.top_domains;
119+
return this.$store.state.activity.browser.top_domains;
120120
},
121121
top_urls: function() {
122-
return this.$store.state.activity_daily.browser.top_urls;
122+
return this.$store.state.activity.browser.top_urls;
123123
},
124124
top_categories: function() {
125-
return this.$store.state.activity_daily.category.top;
125+
return this.$store.state.activity.category.top;
126126
},
127127
top_categories_hierarchy: function() {
128128
if (this.top_categories) {
@@ -145,21 +145,21 @@ export default {
145145
methods: {
146146
get_type_available: function(type) {
147147
if (type === 'top_apps' || type === 'top_titles') {
148-
return this.$store.state.activity_daily.window.available;
148+
return this.$store.state.activity.window.available;
149149
} else if (type === 'top_domains' || type === 'top_urls') {
150-
return this.$store.state.activity_daily.browser.available;
150+
return this.$store.state.activity.browser.available;
151151
} else if (
152152
type === 'top_editor_files' ||
153153
type === 'top_editor_languages' ||
154154
type === 'top_editor_projects'
155155
) {
156-
return this.$store.state.activity_daily.editor.available;
156+
return this.$store.state.activity.editor.available;
157157
} else if (
158158
type === 'top_categories' ||
159159
type === 'category_tree' ||
160160
type === 'category_sunburst'
161161
) {
162-
return this.$store.state.activity_daily.category.available;
162+
return this.$store.state.activity.category.available;
163163
} else {
164164
console.error('Unknown type available: ', type);
165165
return false;

src/route.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import VueRouter from 'vue-router';
33

44
const Home = () => import('./views/Home.vue');
55

6-
// Daily activity views for desktop
7-
const ActivityDaily = () => import('./views/activity/daily/ActivityDaily.vue');
8-
const ActivityDailySummary = () => import('./views/activity/daily/ActivityDailySummary.vue');
9-
const ActivityDailyWindow = () => import('./views/activity/daily/ActivityDailyWindow.vue');
10-
const ActivityDailyBrowser = () => import('./views/activity/daily/ActivityDailyBrowser.vue');
11-
const ActivityDailyEditor = () => import('./views/activity/daily/ActivityDailyEditor.vue');
12-
6+
// Activity views for desktop
7+
const Activity = () => import('./views/activity/Activity.vue');
8+
const ActivitySummary = () => import('./views/activity/ActivitySummary.vue');
9+
const ActivityWindow = () => import('./views/activity/ActivityWindow.vue');
10+
const ActivityBrowser = () => import('./views/activity/ActivityBrowser.vue');
11+
const ActivityEditor = () => import('./views/activity/ActivityEditor.vue');
1312
const ActivityAndroid = () => import('./views/activity/ActivityAndroid.vue');
13+
1414
const Buckets = () => import('./views/Buckets.vue');
1515
const Bucket = () => import('./views/Bucket.vue');
1616
const QueryExplorer = () => import('./views/QueryExplorer.vue');
@@ -29,34 +29,34 @@ const router = new VueRouter({
2929
{ path: '/activity/android/:host/:date?', component: ActivityAndroid, props: true },
3030
{
3131
path: '/activity/:host/:periodLength?/:date?',
32-
component: ActivityDaily,
32+
component: Activity,
3333
props: true,
3434
children: [
3535
{
3636
path: 'summary',
3737
meta: { subview: 'summary' },
38-
name: 'activity-daily-summary',
39-
component: ActivityDailySummary,
38+
name: 'activity-summary',
39+
component: ActivitySummary,
4040
props: true,
4141
},
4242
{
4343
path: 'window',
4444
meta: { subview: 'window' },
45-
name: 'activity-daily-window',
46-
component: ActivityDailyWindow,
45+
name: 'activity-window',
46+
component: ActivityWindow,
4747
props: true,
4848
},
4949
{
5050
path: 'browser',
5151
meta: { subview: 'browser' },
52-
name: 'activity-daily-browser',
53-
component: ActivityDailyBrowser,
52+
name: 'activity-browser',
53+
component: ActivityBrowser,
5454
},
5555
{
5656
path: 'editor',
5757
meta: { subview: 'editor' },
58-
name: 'activity-daily-editor',
59-
component: ActivityDailyEditor,
58+
name: 'activity-editor',
59+
component: ActivityEditor,
6060
},
6161
// Unspecified should redirect to summary view is the summary view
6262
// (needs to be last since otherwise it'll always match first)

src/store/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Vue from 'vue';
22
import Vuex from 'vuex';
3-
import activity_daily from './modules/activity_daily';
3+
import activity from './modules/activity';
44
import buckets from './modules/buckets';
55
import settings from './modules/settings';
66
//import createLogger from '../../../src/plugins/logger';
@@ -11,7 +11,7 @@ const debug = process.env.NODE_ENV !== 'production';
1111

1212
export default new Vuex.Store({
1313
modules: {
14-
activity_daily,
14+
activity,
1515
buckets,
1616
settings,
1717
},
File renamed without changes.

src/views/Dev.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ export default {
3232
},
3333
methods: {
3434
query_window_timing: async function() {
35-
await this.$store.dispatch('activity_daily/query_window', this.queryOptions);
35+
await this.$store.dispatch('activity/query_window', this.queryOptions);
3636
},
3737
query_browser_timing: async function() {
38-
await this.$store.dispatch('activity_daily/query_browser', this.queryOptions);
38+
await this.$store.dispatch('activity/query_browser', this.queryOptions);
3939
},
4040
},
4141
};

src/views/activity/daily/ActivityDaily.vue renamed to src/views/activity/Activity.vue

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ div
55
p
66
| Host: {{ host }}
77
br
8-
| Active time: {{ $store.state.activity_daily.active.duration | friendlyduration }}
8+
| Active time: {{ $store.state.activity.active.duration | friendlyduration }}
99

1010
div.d-flex
1111
div.p-1
@@ -38,16 +38,16 @@ div
3838

3939
ul.row.nav.nav-tabs.my-3.px-3
4040
li.nav-item
41-
router-link.nav-link(:to="{ name: 'activity-daily-summary', params: $route.params }")
41+
router-link.nav-link(:to="{ name: 'activity-summary', params: $route.params }")
4242
h5 Summary
4343
li.nav-item
44-
router-link.nav-link(:to="{ name: 'activity-daily-window', params: $route.params }")
44+
router-link.nav-link(:to="{ name: 'activity-window', params: $route.params }")
4545
h5 Window
4646
li.nav-item
47-
router-link.nav-link(:to="{ name: 'activity-daily-browser', params: $route.params }")
47+
router-link.nav-link(:to="{ name: 'activity-browser', params: $route.params }")
4848
h5 Browser
4949
li.nav-item
50-
router-link.nav-link(:to="{ name: 'activity-daily-editor', params: $route.params }")
50+
router-link.nav-link(:to="{ name: 'activity-editor', params: $route.params }")
5151
h5 Editor
5252

5353
div
@@ -157,9 +157,7 @@ export default {
157157
return `/activity/${this.host}/${this.periodLength}`;
158158
},
159159
periodusage: function() {
160-
return this.$store.getters['activity_daily/getActiveHistoryAroundTimeperiod'](
161-
this.timeperiod
162-
);
160+
return this.$store.getters['activity/getActiveHistoryAroundTimeperiod'](this.timeperiod);
163161
},
164162
timeperiod: function() {
165163
// TODO: Get start of day/week/month (depending on periodLength) with offset
@@ -230,7 +228,7 @@ export default {
230228
},
231229
232230
refresh: async function(force) {
233-
await this.$store.dispatch('activity_daily/ensure_loaded', {
231+
await this.$store.dispatch('activity/ensure_loaded', {
234232
timeperiod: this.timeperiod,
235233
host: this.host,
236234
force: force,
@@ -240,7 +238,7 @@ export default {
240238
},
241239
242240
load_demo: async function() {
243-
await this.$store.dispatch('activity_daily/load_demo');
241+
await this.$store.dispatch('activity/load_demo');
244242
},
245243
},
246244
};

src/views/activity/daily/ActivityDailyBrowser.vue renamed to src/views/activity/ActivityBrowser.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@ div
66
small Make sure you have a browser watcher installed to use this feature
77
div(v-if="browserBuckets.length > 0")
88

9-
h6 Active browser time: {{ $store.state.activity_daily.browser.duration | friendlyduration }}
9+
h6 Active browser time: {{ $store.state.activity.browser.duration | friendlyduration }}
1010

1111
div.row
1212
div.col-md-6
1313
h5 Top Browser Domains
1414
div(v-if="browserBuckets")
15-
aw-summary(:fields="$store.state.activity_daily.browser.top_domains", :namefunc="e => e.data.$domain", :colorfunc="e => e.data.$domain", with_limit)
15+
aw-summary(:fields="$store.state.activity.browser.top_domains", :namefunc="e => e.data.$domain", :colorfunc="e => e.data.$domain", with_limit)
1616

1717
div.col-md-6
1818
h5 Top Browser URLs
1919
div(v-if="browserBuckets")
20-
aw-summary(:fields="$store.state.activity_daily.browser.top_urls", :namefunc="e => e.data.url", :colorfunc="e => e.data.$domain", with_limit)
20+
aw-summary(:fields="$store.state.activity.browser.top_urls", :namefunc="e => e.data.url", :colorfunc="e => e.data.$domain", with_limit)
2121

2222
//div(v-if="periodLength === 'day'")
2323
br
2424
hr
2525
b-form-checkbox(v-model="timelineShowAFK")
2626
| Show AFK time
27-
aw-timeline-inspect(:chunks="$store.state.activity_daily.web_chunks", :show_afk='timelineShowAFK', :chunkfunc='e => e.data.$domain', :eventfunc='e => e.data.url')
27+
aw-timeline-inspect(:chunks="$store.state.activity.web_chunks", :show_afk='timelineShowAFK', :chunkfunc='e => e.data.$domain', :eventfunc='e => e.data.url')
2828
br
2929
</template>
3030

@@ -49,7 +49,7 @@ export default {
4949
},
5050
computed: {
5151
browserBuckets: function() {
52-
return this.$store.state.activity_daily.buckets.browser_buckets;
52+
return this.$store.state.activity.buckets.browser_buckets;
5353
},
5454
},
5555
};

src/views/activity/daily/ActivityDailyEditor.vue renamed to src/views/activity/ActivityEditor.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@ div
55
h6 No editor buckets available
66
small Make sure you have an editor watcher installed to use this feature
77
div(v-if="editorBuckets.length")
8-
h6 Active editor time: {{ $store.state.activity_daily.editor.duration | friendlyduration }}
8+
h6 Active editor time: {{ $store.state.activity.editor.duration | friendlyduration }}
99
div.row(style="padding-top: 0.5em;")
1010
div.col-md-4
1111
h5 Top file activity
12-
aw-summary(:fields="$store.state.activity_daily.editor.top_files",
12+
aw-summary(:fields="$store.state.activity.editor.top_files",
1313
:namefunc="top_editor_files_namefunc",
1414
:colorfunc="top_editor_files_colorfunc", with_limit)
1515

1616
div.col-md-4
1717
h5 Top language activity
18-
aw-summary(:fields="$store.state.activity_daily.editor.top_languages",
18+
aw-summary(:fields="$store.state.activity.editor.top_languages",
1919
:namefunc="top_editor_languages_namefunc",
2020
:colorfunc="top_editor_languages_colorfunc", with_limit)
2121

2222
div.col-md-4
2323
h5 Top project activity
24-
aw-summary(:fields="$store.state.activity_daily.editor.top_projects",
24+
aw-summary(:fields="$store.state.activity.editor.top_projects",
2525
:namefunc="top_editor_projects_namefunc",
2626
:colorfunc="top_editor_projects_colorfunc", with_limit)
2727
br
@@ -63,7 +63,7 @@ export default {
6363
6464
computed: {
6565
editorBuckets: function() {
66-
return this.$store.state.activity_daily.buckets.editor_buckets;
66+
return this.$store.state.activity.buckets.editor_buckets;
6767
},
6868
dateEnd: function() {
6969
return moment(this.date)

src/views/activity/daily/ActivityDailySummary.vue renamed to src/views/activity/ActivitySummary.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,16 @@ export default {
8080
},
8181
computed: {
8282
top_apps: function() {
83-
return this.$store.state.activity_daily.window.top_apps;
83+
return this.$store.state.activity.window.top_apps;
8484
},
8585
top_titles: function() {
86-
return this.$store.state.activity_daily.window.top_titles;
86+
return this.$store.state.activity.window.top_titles;
8787
},
8888
top_categories: function() {
89-
return this.$store.state.activity_daily.category.top;
89+
return this.$store.state.activity.category.top;
9090
},
9191
top_domains: function() {
92-
return this.$store.state.activity_daily.browser.top_domains;
92+
return this.$store.state.activity.browser.top_domains;
9393
},
9494
top_categories_hierarchy: function() {
9595
if (this.top_categories) {
@@ -106,7 +106,7 @@ export default {
106106
}
107107
},
108108
datasets: function() {
109-
const data = split_by_hour_into_data(this.$store.state.activity_daily.active.events);
109+
const data = split_by_hour_into_data(this.$store.state.activity.active.events);
110110
return [
111111
{
112112
label: 'Total time',

src/views/activity/daily/ActivityDailyWindow.vue renamed to src/views/activity/ActivityWindow.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ export default {
3737
},
3838
computed: {
3939
top_apps: function() {
40-
return this.$store.state.activity_daily.window.top_apps;
40+
return this.$store.state.activity.window.top_apps;
4141
},
4242
top_titles: function() {
43-
return this.$store.state.activity_daily.window.top_titles;
43+
return this.$store.state.activity.window.top_titles;
4444
},
4545
bucket_id_window: function() {
46-
return this.$store.state.activity_daily.buckets.window_buckets[0];
46+
return this.$store.state.activity.buckets.window_buckets[0];
4747
},
4848
bucket_id_afk: function() {
49-
return this.$store.state.activity_daily.buckets.afk_buckets[0];
49+
return this.$store.state.activity.buckets.afk_buckets[0];
5050
},
5151
},
5252
};

0 commit comments

Comments
 (0)