forked from umami-software/umami
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request umami-software#476 from gnarlex/event-type-selection
Dashboard: Dropdown for filtering events by their type
- Loading branch information
Showing
9 changed files
with
138 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.filter { | ||
display: flex; | ||
justify-content: flex-start; | ||
align-items: center; | ||
margin-bottom: 15px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { getEventTypes } from 'lib/queries'; | ||
import { ok, methodNotAllowed, unauthorized } from 'lib/response'; | ||
import { allowQuery } from 'lib/auth'; | ||
|
||
export default async (req, res) => { | ||
if (req.method === 'GET') { | ||
if (!(await allowQuery(req))) { | ||
return unauthorized(res); | ||
} | ||
|
||
const { id, start_at, end_at, url } = req.query; | ||
|
||
const websiteId = +id; | ||
const startDate = new Date(+start_at); | ||
const endDate = new Date(+end_at); | ||
|
||
const eventTypes = await getEventTypes(websiteId, startDate, endDate, undefined, undefined, { | ||
url, | ||
}); | ||
|
||
return ok(res, eventTypes); | ||
} | ||
|
||
return methodNotAllowed(res); | ||
}; |