diff --git a/src/App.vue b/src/App.vue index 17ad9f9..0e8857c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -64,9 +64,14 @@ export default class App extends Vue { }, }; + toolFilter: string | null = null; + created() { // refresh data every five minutes window.setInterval(this.refresh, 5 * 60 * 1000); + + const urlParams = new URLSearchParams(window.location.search); + this.toolFilter = urlParams.get('tool'); } refresh() { @@ -79,12 +84,16 @@ export default class App extends Vue { }); } - eventDataTransform(eventData: EventInput): EventInput { - const match = eventData.title.match(/([^\/]*) \/ ([^-]*) - (.*)/); + eventDataTransform(eventData: EventInput): EventInput | false { + const match = eventData.title.match(/([^\/]*) \| ([^-]*) - (.*)/); if (match !== null) { - eventData.title = match[3]; + const [, member, shop, tool] = match; + eventData.title = member; + if (this.toolFilter === null || tool.includes(this.toolFilter)) { + return eventData; + } } - return eventData; + return false; } }