Skip to content

Commit

Permalink
ESLint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kenbailey committed Jan 7, 2024
1 parent 0d15764 commit fd130e9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
7 changes: 2 additions & 5 deletions src/util/swimlane.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import moment from 'moment';
import { seconds_to_duration } from './time';
import DOMPurify from 'dompurify';
import _ from 'lodash';

const sanitize = DOMPurify.sanitize;

Expand All @@ -16,12 +13,12 @@ export function getSwimlane(bucket, color, groupBy, e) {
if (bucket.type == 'currentwindow') {
subgroup = sanitize(e.data.app);
} else if (bucket.type == 'web.tab.current') {
subgroup = sanitize((new URL(e.data.url)).hostname.replace('www.',''));
subgroup = sanitize((new URL(e.data.url)).hostname.replace('www.', ''));

Check warning on line 16 in src/util/swimlane.js

View workflow job for this annotation

GitHub Actions / Build (node-16)

Replace `(new·URL(e.data.url)` with `new·URL(e.data.url`

Check warning on line 16 in src/util/swimlane.js

View workflow job for this annotation

GitHub Actions / lint (20.x)

Replace `(new·URL(e.data.url)` with `new·URL(e.data.url`
} else if (bucket.type.startsWith('app.editor')) {
subgroup = sanitize(e.data.language);
} else if (bucket.type.startsWith('general.stopwatch')) {
subgroup = sanitize(e.data.label);
}
}
}

return subgroup;
Expand Down
12 changes: 6 additions & 6 deletions src/views/Timeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default {
return _.sumBy(this.buckets, 'events.length');
},
filter_summary() {
let desc = [];
const desc = [];
if (this.filter_hostname) {
desc.push(this.filter_hostname);
}
Expand All @@ -102,13 +102,13 @@ export default {
}
if (this.filter_duration > 0) {
desc.push(seconds_to_duration(this.filter_duration));
}
}
if (desc.length > 0) {
return desc.join(", ");
return desc.join(', ');
}
return "none"
}
return 'none'

Check warning on line 110 in src/views/Timeline.vue

View workflow job for this annotation

GitHub Actions / Build (node-16)

Insert `;`

Check warning on line 110 in src/views/Timeline.vue

View workflow job for this annotation

GitHub Actions / lint (20.x)

Insert `;`
},
},
watch: {
daterange() {
Expand Down Expand Up @@ -152,7 +152,7 @@ export default {
if (this.filter_client) {
buckets = _.filter(buckets, b => b.client == this.filter_client);
}
if (this.filter_duration > 0) {
for (const bucket of buckets) {
bucket.events = _.filter(bucket.events, e => e.duration >= this.filter_duration);
Expand Down
2 changes: 1 addition & 1 deletion src/visualizations/VisTimeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export default {
}
events.sort((a, b) => a.timestamp.valueOf() - b.timestamp.valueOf());
_.each(events, e => {
let color = getColorFromString(getTitleAttr(bucket, e));
const color = getColorFromString(getTitleAttr(bucket, e));
data.push([
bucket.id,
getTitleAttr(bucket, e),
Expand Down

1 comment on commit fd130e9

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are screenshots of this commit:

Screenshots using aw-server v0.12.3b11 (click to expand)

Screenshots using aw-server-rust master (click to expand)

Screenshots using aw-server-rust v0.12.3b11 (click to expand)

Please sign in to comment.