mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
MySQL query optimization. Added loading component.
This commit is contained in:
parent
a7e7469d22
commit
ccb98f836f
13 changed files with 158 additions and 109 deletions
|
|
@ -49,12 +49,13 @@ export const urlFilter = (data, { domain, raw }) => {
|
|||
};
|
||||
|
||||
export const refFilter = (data, { domain, domainOnly, raw }) => {
|
||||
const regex = new RegExp(domain.startsWith('http') ? domain : `http[s]?://${domain}`);
|
||||
|
||||
const isValidRef = ref => {
|
||||
return ref !== '' && !ref.startsWith('/') && !ref.startsWith('#');
|
||||
};
|
||||
|
||||
if (raw) {
|
||||
const regex = new RegExp(`http[s]?://${domain}`);
|
||||
return data.filter(({ x }) => isValidRef(x) && !regex.test(x));
|
||||
}
|
||||
|
||||
|
|
@ -62,7 +63,7 @@ export const refFilter = (data, { domain, domainOnly, raw }) => {
|
|||
try {
|
||||
const { hostname, origin, pathname, searchParams, protocol } = new URL(url);
|
||||
|
||||
if (hostname === domain) {
|
||||
if (hostname === domain || regex.test(url)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue