mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-03-14 13:24:47 +00:00
Compare commits
No commits in common. "d0d03c05d6a4fdd6bf7513f7470a6e7ac2ab2595" and "c486e5bff9af6caa1eb180fb0fa950e9c6c084b0" have entirely different histories.
d0d03c05d6
...
c486e5bff9
1 changed files with 8 additions and 15 deletions
|
@ -324,21 +324,14 @@ export default {
|
|||
// finds monitor name, tag name or tag value
|
||||
let searchTextMatch = true;
|
||||
if (this.searchText !== "") {
|
||||
try {
|
||||
const regex = new RegExp(this.searchText, "i"); // "i" for case-insensitive matching
|
||||
|
||||
const safeRegexTest = (str) => str && regex.test(str);
|
||||
|
||||
const loweredSearchText = this.searchText.toLowerCase();
|
||||
searchTextMatch =
|
||||
regex.test(monitor.name) ||
|
||||
safeRegexTest(monitor.url) ||
|
||||
safeRegexTest(monitor.hostname) ||
|
||||
safeRegexTest(monitor.dns_resolve_server) ||
|
||||
monitor.tags.some(tag => regex.test(tag.name) || safeRegexTest(tag.value));
|
||||
} catch (e) {
|
||||
console.error("Invalid regex pattern:", e);
|
||||
searchTextMatch = false;
|
||||
}
|
||||
monitor.name.toLowerCase().includes(loweredSearchText)
|
||||
|| monitor.url?.toLowerCase().includes(loweredSearchText)
|
||||
|| monitor.hostname?.toLowerCase().includes(loweredSearchText)
|
||||
|| monitor.dns_resolve_server?.toLowerCase().includes(loweredSearchText)
|
||||
|| monitor.tags.find(tag => tag.name.toLowerCase().includes(loweredSearchText)
|
||||
|| tag.value?.toLowerCase().includes(loweredSearchText));
|
||||
}
|
||||
|
||||
// filter by status
|
||||
|
|
Loading…
Add table
Reference in a new issue