Skip to content

Commit 91878ee

Browse files
committed
style: fixed lints, applied prettier v2 style, removed old Log view
1 parent 5b35c95 commit 91878ee

39 files changed

Lines changed: 162 additions & 268 deletions

src/App.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ import 'vue-awesome/icons/brands/twitter';
3939
import 'vue-awesome/icons/brands/github';
4040
4141
export default {
42-
data: function() {
42+
data: function () {
4343
return {
4444
activityViews: [],
4545
info: {},
4646
};
4747
},
4848
49-
mounted: async function() {
49+
mounted: async function () {
5050
this.$aw.getInfo().then(
5151
info => {
5252
this.info = info;

src/components/CategoryEditTree.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ import 'vue-awesome/icons/trash';
5454
import 'vue-awesome/icons/plus';
5555
import 'vue-awesome/icons/edit';
5656
57+
import _ from 'lodash';
58+
5759
export default {
5860
name: 'CategoryEditTree',
5961
props: {
@@ -75,14 +77,14 @@ export default {
7577
};
7678
},
7779
computed: {
78-
allCategories: function() {
80+
allCategories: function () {
7981
const categories = this.$store.getters['settings/all_categories'];
8082
const entries = categories.map(c => {
8183
return { text: c.join('->'), value: c };
8284
});
8385
return [{ value: [], text: 'None' }].concat(entries);
8486
},
85-
allRuleTypes: function() {
87+
allRuleTypes: function () {
8688
return [
8789
{ value: null, text: 'None' },
8890
{ value: 'regex', text: 'Regular Expression' },
@@ -91,13 +93,13 @@ export default {
9193
},
9294
},
9395
methods: {
94-
addSubclass: function(parent) {
96+
addSubclass: function (parent) {
9597
this.$store.commit('settings/addClass', {
9698
name: parent.name.concat(['New class']),
9799
rule: { type: 'regex', regex: 'FILL ME' },
98100
});
99101
},
100-
removeClass: function(_class) {
102+
removeClass: function (_class) {
101103
// TODO: Show a confirmation dialog
102104
// TODO: Remove children as well?
103105
// TODO: Move button to edit modal?

src/components/EventEditor.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,21 @@ export default {
6767
},
6868
computed: {
6969
start: {
70-
get: function() {
70+
get: function () {
7171
return moment(this.editedEvent.timestamp).format();
7272
},
73-
set: function(dt) {
73+
set: function (dt) {
7474
// Duration needs to be set first since otherwise the computed for end will use the new timestamp
7575
this.editedEvent.duration = moment(this.end).diff(dt, 'seconds');
7676
this.editedEvent.timestamp = new Date(dt);
7777
},
7878
},
7979
end: {
80-
get: function() {
80+
get: function () {
8181
const end = moment(this.editedEvent.timestamp).add(this.editedEvent.duration, 'seconds');
8282
return end.format();
8383
},
84-
set: function(dt) {
84+
set: function (dt) {
8585
this.editedEvent.duration = moment(dt).diff(this.editedEvent.timestamp, 'seconds');
8686
},
8787
},

src/components/Header.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export default {
8484
activityViews: [],
8585
};
8686
},
87-
mounted: async function() {
87+
mounted: async function () {
8888
const buckets = await this.$aw.getBuckets();
8989
const types_by_host = {};
9090

src/components/SelectableVisualization.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export default {
8484
id: Number,
8585
type: String,
8686
},
87-
data: function() {
87+
data: function () {
8888
return {
8989
types: [
9090
'top_apps',
@@ -119,7 +119,7 @@ export default {
119119
};
120120
},
121121
computed: {
122-
visualizations: function() {
122+
visualizations: function () {
123123
return {
124124
top_apps: {
125125
title: 'Top Applications',
@@ -165,7 +165,7 @@ export default {
165165
},
166166
};
167167
},
168-
top_categories_hierarchy: function() {
168+
top_categories_hierarchy: function () {
169169
const top_categories = this.$store.state.activity.category.top;
170170
if (top_categories) {
171171
const categories = top_categories.map(c => {

src/components/StopwatchEntry.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,17 @@ export default {
5151
},
5252
},
5353
methods: {
54-
stop: async function() {
54+
stop: async function () {
5555
let new_event = JSON.parse(JSON.stringify(this.event));
5656
new_event.data.running = false;
5757
new_event.duration = (moment() - moment(new_event.timestamp)) / 1000;
5858
new_event = await this.$aw.replaceEvent(this.bucket_id, new_event);
5959
this.$emit('update', new_event);
6060
},
61-
save: async function(new_event) {
61+
save: async function (new_event) {
6262
this.$emit('update', new_event);
6363
},
64-
delete_: async function(new_event) {
64+
delete_: async function (new_event) {
6565
this.$emit('delete', new_event);
6666
},
6767
},

src/mixins/asyncErrorCaptured.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ function handleError(error, vm, info) {
1414
}
1515

1616
export default {
17-
beforeCreate: function() {
17+
beforeCreate: function () {
1818
const that = this;
1919
const methods = this.$options.methods || {};
2020
for (const key in methods) {
2121
const original = methods[key];
22-
methods[key] = function(...args) {
22+
methods[key] = function (...args) {
2323
try {
2424
const result = original.apply(this, args);
2525
// let's analyse what is returned from the method
2626
if (result && typeof result.then === 'function' && typeof result.catch === 'function') {
2727
// this looks like a Promise. let's handle it's errors:
28-
return result.catch(function(err) {
28+
return result.catch(function (err) {
2929
handleError(err, that, key);
3030
});
3131
} else return result;

src/route.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ const Buckets = () => import('./views/Buckets.vue');
1414
const Bucket = () => import('./views/Bucket.vue');
1515
const QueryExplorer = () => import('./views/QueryExplorer.vue');
1616
const Timeline = () => import('./views/Timeline.vue');
17-
const Log = () => import('./views/Log.vue');
1817
const Settings = () => import('./views/settings/Settings.vue');
1918
const Stopwatch = () => import('./views/Stopwatch.vue');
2019
const Dev = () => import('./views/Dev.vue');
@@ -67,7 +66,6 @@ const router = new VueRouter({
6766
{ path: '/buckets/:id', component: Bucket, props: true },
6867
{ path: '/timeline', component: Timeline },
6968
{ path: '/query', component: QueryExplorer },
70-
{ path: '/log', component: Log },
7169
{ path: '/settings', component: Settings },
7270
{ path: '/stopwatch', component: Stopwatch },
7371
{ path: '/dev', component: Dev },

src/util/filters.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@ import { seconds_to_duration, friendlydate } from './time.js';
66

77
import moment from 'moment';
88

9-
Vue.filter('shortdate', function(timestamp) {
9+
Vue.filter('shortdate', function (timestamp) {
1010
return moment(timestamp).format('YYYY-MM-DD');
1111
});
1212

13-
Vue.filter('shorttime', function(timestamp) {
13+
Vue.filter('shorttime', function (timestamp) {
1414
return moment(timestamp).format('HH:mm');
1515
});
1616

17-
Vue.filter('friendlytime', function(timestamp) {
17+
Vue.filter('friendlytime', function (timestamp) {
1818
return friendlydate(timestamp);
1919
});
2020

21-
Vue.filter('iso8601', function(timestamp) {
21+
Vue.filter('iso8601', function (timestamp) {
2222
return moment.parseZone(timestamp).format();
2323
});
2424

25-
Vue.filter('friendlyduration', function(seconds) {
25+
Vue.filter('friendlyduration', function (seconds) {
2626
return seconds_to_duration(seconds);
2727
});
2828

src/util/time.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,11 @@ export function get_day_start_with_offset(dateParam) {
2929
const start_of_day = localStorage.startOfDay;
3030
const start_of_day_hours = parseInt(start_of_day.split(':')[0]);
3131
const start_of_day_minutes = parseInt(start_of_day.split(':')[1]);
32-
return dateMoment
33-
.hour(start_of_day_hours)
34-
.minute(start_of_day_minutes)
35-
.format();
32+
return dateMoment.hour(start_of_day_hours).minute(start_of_day_minutes).format();
3633
}
3734

3835
export function get_day_end_with_offset(date) {
39-
return moment(get_day_start_with_offset(date))
40-
.add(1, 'days')
41-
.format();
36+
return moment(get_day_start_with_offset(date)).add(1, 'days').format();
4237
}
4338

4439
export function get_day_period(date) {
@@ -61,8 +56,5 @@ export function get_offset() {
6156

6257
export function get_today() {
6358
// Gets "today" in an offset-aware way
64-
return moment()
65-
.subtract(get_offset())
66-
.startOf('day')
67-
.format('YYYY-MM-DD');
59+
return moment().subtract(get_offset()).startOf('day').format('YYYY-MM-DD');
6860
}

0 commit comments

Comments
 (0)